Skip to content

Commit

Permalink
fix: fix py37 (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 authored Nov 9, 2023
1 parent f47fd68 commit b900ff2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/psygnal/_group_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,10 @@ def __get__(

# clean up the cache when the instance is deleted
with contextlib.suppress(TypeError):
weakref.finalize(instance, self._instance_map.pop, obj_id, None)
# on 3.7 this is type error, above it's not... but mypy yells about
# type ignore on 3.8+, so we do this funny business instead.
args = (instance, self._instance_map.pop, obj_id, None)
weakref.finalize(*args) # type: ignore

return self._instance_map[obj_id]

Expand Down

0 comments on commit b900ff2

Please sign in to comment.