[pypy-commit] pypy release-5.x: import cffi/cb6147abe7af
mattip
pypy.commits at gmail.com
Sun Sep 4 11:00:34 EDT 2016
Author: Matti Picus <matti.picus at gmail.com>
Branch: release-5.x
Changeset: r86867:dfa482ad3f4c
Date: 2016-09-04 17:55 +0300
http://bitbucket.org/pypy/pypy/changeset/dfa482ad3f4c/
Log: import cffi/cb6147abe7af (grafted from
c224171fc33e53442553735d23896c4cd2d51b34)
diff --git a/lib_pypy/cffi/backend_ctypes.py b/lib_pypy/cffi/backend_ctypes.py
--- a/lib_pypy/cffi/backend_ctypes.py
+++ b/lib_pypy/cffi/backend_ctypes.py
@@ -1009,6 +1009,12 @@
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
diff --git a/pypy/module/test_lib_pypy/cffi_tests/cffi0/test_zintegration.py b/pypy/module/test_lib_pypy/cffi_tests/cffi0/test_zintegration.py
--- a/pypy/module/test_lib_pypy/cffi_tests/cffi0/test_zintegration.py
+++ b/pypy/module/test_lib_pypy/cffi_tests/cffi0/test_zintegration.py
@@ -154,7 +154,10 @@
from cffi.setuptools_ext import _set_py_limited_api
try:
import setuptools
- orig_version = setuptools.__version__
+ except ImportError as e:
+ py.test.skip(str(e))
+ orig_version = setuptools.__version__
+ try:
setuptools.__version__ = '26.0.0'
from setuptools import Extension
More information about the pypy-commit
mailing list