Skip to content

Commit aa30380

Browse files
committed
refactor(copy): simplify _exclude_from initialization with default []
1 parent aa7bbf4 commit aa30380

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

hpccm/primitives/copy.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,10 @@ def __init__(self, **kwargs):
111111
self._post = kwargs.get('_post', '') # Singularity specific
112112
self.__src = kwargs.get('src', '')
113113

114-
ef = kwargs.get('_exclude_from', None)
115-
if ef is None:
116-
self.__exclude_from = []
117-
elif isinstance(ef, (list, tuple)):
114+
ef = kwargs.get('_exclude_from', [])
115+
if isinstance(ef, (list, tuple)):
118116
self.__exclude_from = list(ef)
119-
else:
117+
elif ef:
120118
self.__exclude_from = [ef]
121119

122120
if self._mkdir and self._post:

0 commit comments

Comments
 (0)