Skip to content

Commit e2b3c8d

Browse files
committed
places a guard in the Task.__eq__ so it can be compared with non-Task objects (and return False)
1 parent d6daad9 commit e2b3c8d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pydra/compose/base/task.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ def __iter__(self) -> ty.Generator[str, None, None]:
404404
def __eq__(self, other: ty.Any) -> bool:
405405
"""Check if two tasks are equal"""
406406
values = attrs.asdict(self, recurse=False)
407+
if not attrs.has(other):
408+
return False
407409
try:
408410
other_values = attrs.asdict(other, recurse=False)
409411
except AttributeError:

0 commit comments

Comments
 (0)