Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
gevent / src / greentest / test__refcount_core.py
Size: Mime:
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:
    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