diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 472c40c248..ccf20ebcb1 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -2943,7 +2943,7 @@ def __init__(self, infields=None, **kwargs): undefined_traits = {} for key in self._infields: self.inputs.add_trait(key, traits.Any) - undefined_traits[key] = kwargs[key] if key in kwargs else Undefined + undefined_traits[key] = kwargs.get(key, Undefined) self.inputs.trait_set(trait_change_notify=False, **undefined_traits)