Skip to content

Commit aa03d04

Browse files
committed
fix: only check for version compatibility when inputs are defined
1 parent ac6709b commit aa03d04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nipype/interfaces/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,12 +801,16 @@ def _check_input_version_requirements(self):
801801
# check minimum version
802802
names = self.inputs.trait_names(**dict(min_ver=lambda t: t is not None))
803803
for name in names:
804+
if not isdefined(getattr(self.inputs, name)):
805+
continue
804806
min_ver = str(self.inputs.traits()[name].min_ver)
805807
if min_ver > version:
806808
raise Exception('Input %s (%s) (version %s < required %s)' %
807809
(name, self.__class__.__name__, version, min_ver))
808810
names = self.inputs.trait_names(**dict(max_ver=lambda t: t is not None))
809811
for name in names:
812+
if not isdefined(getattr(self.inputs, name)):
813+
continue
810814
max_ver = str(self.inputs.traits()[name].max_ver)
811815
if max_ver < version:
812816
raise Exception('Input %s (%s) (version %s > required %s)' %

0 commit comments

Comments
 (0)