Skip to content

Commit

Permalink
Don't reuse variable
Browse files Browse the repository at this point in the history
Locally mypy doesn't care about this, but somehow on the CI it whines, even though the mypy version is allegedly the same.

Signed-off-by: liamhuber <[email protected]>
  • Loading branch information
liamhuber committed Jan 17, 2025
1 parent fcb341a commit e3d1ada
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pyiron_workflow/mixin/semantics.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,18 +368,19 @@ def _add_suffix_to_label(self, label: str) -> str:

def remove_child(self, child: ChildType | str) -> ChildType:
if isinstance(child, str):
child = self.children.pop(child)
child_instance = self.children.pop(child)
elif isinstance(child, self.child_type()):
self.children.inv.pop(child)
child_instance = child
else:
raise TypeError(
f"{self.label} expected to remove a child of type str or "
f"{self.child_type()} but got {child}"
)

child.parent = None
child_instance.parent = None

return child
return child_instance

def __getstate__(self):
state = super().__getstate__()
Expand Down

0 comments on commit e3d1ada

Please sign in to comment.