Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: cpyext-leakchecking
Changeset: r91964:5bba19e669b0
Date: 2017-07-25 13:30 +0200
http://bitbucket.org/pypy/pypy/changeset/5bba19e669b0/

Log:    Filter out C functions

diff --git a/pypy/module/cpyext/test/test_cpyext.py 
b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -84,10 +84,13 @@
 def is_allowed_to_leak(space, obj):
     from pypy.module.cpyext.pyobject import from_ref
     from pypy.module.cpyext.api import cts
+    from pypy.module.cpyext.methodobject import W_PyCFunctionObject
     try:
         w_obj = from_ref(space, cts.cast('PyObject*', obj._as_ptr()))
     except:
         return False
+    if isinstance(w_obj, W_PyCFunctionObject):
+        return True
     # It's OK to "leak" some interned strings: if the pyobj is created by
     # the test, but the w_obj is referred to from elsewhere.
     return is_interned_string(space, w_obj)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to