Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r2758:b81ca61b6de6
Date: 2016-09-03 20:10 +0200
http://bitbucket.org/cffi/cffi/changeset/b81ca61b6de6/

Log:    fix

diff --git a/cffi/backend_ctypes.py b/cffi/backend_ctypes.py
--- a/cffi/backend_ctypes.py
+++ b/cffi/backend_ctypes.py
@@ -1004,9 +1004,11 @@
             import weakref
             class MyRef(weakref.ref):
                 def __eq__(self, other):
-                    return self() is other()
+                    myref = self()
+                    return self is other or (
+                        myref is not None and myref is other())
                 def __ne__(self, other):
-                    return self() is not other()
+                    return not (self == other)
             self._weakref_cache_ref = {}, MyRef
         weak_cache, MyRef = self._weakref_cache_ref
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to