diff options
author | Armin Rigo <arigo@tunes.org> | 2016-09-03 23:42:59 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2016-09-03 23:42:59 +0200 |
commit | 09973eefe01cd6000365a47a81f6818b867ea357 (patch) | |
tree | a8585adfcee6d603b1e43289ead135caf9792e9e | |
parent | cdede2fb38671c5b1d5d34871db411749a9efcd2 (diff) | |
download | cffi-09973eefe01cd6000365a47a81f6818b867ea357.tar.gz |
Python 3 fix
-rw-r--r-- | cffi/backend_ctypes.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cffi/backend_ctypes.py b/cffi/backend_ctypes.py index d160fa7..1002fac 100644 --- a/cffi/backend_ctypes.py +++ b/cffi/backend_ctypes.py @@ -1009,6 +1009,12 @@ class CTypesBackend(object): myref is not None and myref is other()) def __ne__(self, other): return not (self == other) + def __hash__(self): + try: + return self._hash + except AttributeError: + self._hash = hash(self()) + return self._hash self._weakref_cache_ref = {}, MyRef weak_cache, MyRef = self._weakref_cache_ref |