Skip to content

Commit ba2eac6

Browse files
STY: Apply ruff/flake8-simplify rule SIM401
SIM401 Use `.get()` instead of an `if` block
1 parent bcc2825 commit ba2eac6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nipype/interfaces/io.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,7 @@ def __init__(self, infields=None, **kwargs):
29432943
undefined_traits = {}
29442944
for key in self._infields:
29452945
self.inputs.add_trait(key, traits.Any)
2946-
undefined_traits[key] = kwargs[key] if key in kwargs else Undefined
2946+
undefined_traits[key] = kwargs.get(key, Undefined)
29472947

29482948
self.inputs.trait_set(trait_change_notify=False, **undefined_traits)
29492949

0 commit comments

Comments
 (0)