Skip to content

Commit 3d6d91f

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

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
@@ -2942,7 +2942,7 @@ def __init__(self, infields=None, **kwargs):
29422942
undefined_traits = {}
29432943
for key in self._infields:
29442944
self.inputs.add_trait(key, traits.Any)
2945-
undefined_traits[key] = kwargs[key] if key in kwargs else Undefined
2945+
undefined_traits[key] = kwargs.get(key, Undefined)
29462946

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

0 commit comments

Comments
 (0)