We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 377dcd9 commit a1807abCopy full SHA for a1807ab
asyncio_atexit.py
@@ -21,7 +21,13 @@
21
22
class _RegistryEntry:
23
def __init__(self, loop):
24
- self._close_ref = weakref.WeakMethod(loop.close)
+ try:
25
+ self._close_ref = weakref.WeakMethod(loop.close)
26
+ except TypeError:
27
+ # not everything can be weakref'd (Extensions such as uvloop).
28
+ # Hold a regular reference _on the object_, in those cases
29
+ loop._atexit_orig_close = loop.close
30
+ self._close_ref = lambda: loop._atexit_orig_close
31
self.callbacks = []
32
33
def close(self):
0 commit comments