Skip to content

Commit a2da63c

Browse files
committed
Check if input is in exlusion list before testing it
1 parent 0a79080 commit a2da63c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pydra/engine/specs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ def check_fields_input_spec(self):
164164
if getattr(self, fld.name) is attr.NOTHING:
165165
if mdata.get("mandatory"):
166166
# checking if the mandatory field is provided elsewhere in the xor list
167-
alreday_populated = [getattr(self, el) for el in mdata["xor"] if (getattr(self, el) is not attr.NOTHING)]
167+
in_exclusion_list = mdata.get("xor") is not None
168+
alreday_populated = in_exclusion_list and [getattr(self, el) for el in mdata["xor"] if (getattr(self, el) is not attr.NOTHING)]
168169
if alreday_populated: #another input satisfies mandatory attribute via xor condition
169170
continue
170171
else:

0 commit comments

Comments
 (0)