Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r61770:c1f8ea45dc6a
Date: 2013-02-25 11:33 -0800
http://bitbucket.org/pypy/pypy/changeset/c1f8ea45dc6a/

Log:    substitute gc.getreferents for getrefcount (thanks fijal)

diff --git a/lib-python/3.2/test/test_memoryview.py 
b/lib-python/3.2/test/test_memoryview.py
--- a/lib-python/3.2/test/test_memoryview.py
+++ b/lib-python/3.2/test/test_memoryview.py
@@ -11,7 +11,11 @@
 import array
 import io
 
-getrefcount = sys.getrefcount if hasattr(sys, 'getrefcount') else lambda o: -1
+try:
+    getrefcount = sys.getrefcount
+except AttributeError:
+    # PyPy
+    getrefcount = lambda o: len(gc.get_referents(o))
 
 class AbstractMemoryTests:
     source_bytes = b"abcdef"
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to