Skip to content

Commit 4be65d2

Browse files
committed
Fix
Signed-off-by: Eric Kerfoot <[email protected]>
1 parent 60d946b commit 4be65d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

monai/transforms/inverse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ def _init_trace_threadlocal(self):
8585
def __getstate__(self):
8686
"""When pickling, remove the `_tracing` member from the output, if present, since it's not picklable."""
8787
_dict = dict(getattr(self, "__dict__", {})) # this makes __dict__ always present in the unpickled object
88-
_slots = getattr(self, "__slots__", None)
88+
_slots = {k: getattr(self, k) for k in getattr(self, "__slots__", [])}
8989
_dict.pop("_tracing", None) # remove tracing
90-
return _dict if _slots is None else (_dict, _slots)
90+
return _dict if len(_slots) == 0 else (_dict, _slots)
9191

9292
@property
9393
def tracing(self) -> bool:

0 commit comments

Comments
 (0)