Skip to content

Commit 0b16c85

Browse files
committed
rev: initiate fields as None
1 parent af459a8 commit 0b16c85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nipype/interfaces/bids_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class BIDSDataGrabber(BaseInterface):
8080
output_spec = DynamicTraitedSpec
8181
_always_run = True
8282

83-
def __init__(self, infields=[], **kwargs):
83+
def __init__(self, infields=None, **kwargs):
8484
"""
8585
Parameters
8686
----------
@@ -98,7 +98,7 @@ def __init__(self, infields=[], **kwargs):
9898
"anat": {"modality": "anat"}}
9999

100100
# If infields is empty, use all BIDS entities
101-
if not infields and have_pybids:
101+
if not infields is None and have_pybids:
102102
bids_config = join(dirname(gb.__file__), 'config', 'bids.json')
103103
bids_config = json.load(open(bids_config, 'r'))
104104
infields = [i['name'] for i in bids_config['entities']]
@@ -107,7 +107,7 @@ def __init__(self, infields=[], **kwargs):
107107

108108
# used for mandatory inputs check
109109
undefined_traits = {}
110-
for key in infields:
110+
for key in infields or []:
111111
self.inputs.add_trait(key, traits.Any)
112112
undefined_traits[key] = kwargs[key] if key in kwargs else Undefined
113113

0 commit comments

Comments
 (0)