You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__refcount_core.py

25 lines
509 B

import weakref
class Dummy:
def __init__(self):
__import__('gevent.core')
try:
assert weakref.ref(Dummy())() is None
from gevent import socket
s = socket.socket()
r = weakref.ref(s)
s.close()
del s
assert r() is None
except AssertionError: # pragma: no cover
import sys
if hasattr(sys, 'pypy_version_info'):
# PyPy uses a non refcounted GC which may defer
# the collection of the weakref, unlike CPython
pass
else:
raise