Skip to content

Commit 2916d82

Browse files
TEMP: Tweak handling of atexit unregistering
1 parent b0f7382 commit 2916d82

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/conftest.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,11 @@ def aioca_cleanup():
7979
# by cothread. If we don't do this we get a seg fault. This is not a problem
8080
# in production as we won't mix aioca and cothread, but we do mix them in
8181
# the tests so need to do this.
82-
# In aioca 1.8 the name of the cleanup function changed.
83-
if Version(__version__) >= Version("1.8"):
84-
unregister_func = _catools._Context._teardown
85-
else:
82+
# In aioca 1.8 the atexit function was changed to no longer cause this issue
83+
if Version(__version__) < Version("1.8"):
8684
unregister_func = _catools._Context._destroy_context
85+
atexit.unregister(unregister_func)
8786

88-
atexit.unregister(unregister_func)
8987
# purge the channels before the event loop goes
9088
purge_channel_caches()
9189

0 commit comments

Comments
 (0)