Skip to content

Commit

Permalink
TEMP: Tweak handling of atexit unregistering
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWells-diamond committed Nov 4, 2024
1 parent b0f7382 commit 2916d82
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ def aioca_cleanup():
# by cothread. If we don't do this we get a seg fault. This is not a problem
# in production as we won't mix aioca and cothread, but we do mix them in
# the tests so need to do this.
# In aioca 1.8 the name of the cleanup function changed.
if Version(__version__) >= Version("1.8"):
unregister_func = _catools._Context._teardown
else:
# In aioca 1.8 the atexit function was changed to no longer cause this issue
if Version(__version__) < Version("1.8"):
unregister_func = _catools._Context._destroy_context
atexit.unregister(unregister_func)

atexit.unregister(unregister_func)
# purge the channels before the event loop goes
purge_channel_caches()

Expand Down

0 comments on commit 2916d82

Please sign in to comment.