summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2020-03-05 09:52:35 -0600
committerJason Madden <jamadden@gmail.com>2020-03-09 12:51:18 -0500
commit1e720c3819b8daa07aaad0ee0258d9035597f27d (patch)
tree93f0ad828f0d8c8d23670aefeeeccaead854794a /setup.py
parentc931999371b106ca4638a5cfb40fe0e431840358 (diff)
downloadzope-interface-issue11.tar.gz
Make provided/implementedBy and adapter registries respect super().issue11
The query functions now start by looking at the next class in the MRO (interfaces directly provided by the underlying object are not found). Adapter registries automatically pick up providedBy change to start finding the correct implementations of adapters, but to make that really useful they needed to change to unpack super() arguments and pass __self__ to the factory. Fixes #11 Unfortunately, this makes PyPy unable to build the C extensions. Additional crash-safety for adapter lookup. Make the C functions get the cache only after resolving the ``required`` into a tuple, in case of side-effects like...clearing the cache. This could lead to the ``cache`` object being deallocated before we used it. Drop the ``tuplefy`` function in favor of a direct call to ``PySequence_Tuple``. It's what the ``tuple`` constructor would do anyway and saves a few steps. Make sure that getting ``providedBy(super())`` and ``implementedBy(super())`` have no side effects.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index b5e87a8..9b8b4b8 100644
--- a/setup.py
+++ b/setup.py
@@ -69,10 +69,12 @@ codeoptimization = [
]
is_jython = 'java' in sys.platform
+is_pypy = hasattr(sys, 'pypy_version_info')
-# Jython cannot build the C optimizations. Everywhere else,
-# including PyPy, defer the decision to runtime.
-if is_jython:
+# Jython cannot build the C optimizations. Nor, as of 7.3, can PyPy (
+# it doesn't have PySuper_Type) Everywhere else, defer the decision to
+# runtime.
+if is_jython or is_pypy:
ext_modules = []
else:
ext_modules = codeoptimization