Skip to content

Commit cf7e668

Browse files
committed
Whitelist murmur3 extension for PyPy runtime
1 parent e08fefc commit cf7e668

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

setup.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def run_setup(extensions):
268268
[Extension('cassandra.%s' % m, ['cassandra/%s.py' % m], extra_compile_args=compile_args) for m in cython_candidates],
269269
exclude_failures=True))
270270
except ImportError:
271-
print("Cython is not installed. Not compiling core driver files as extensions (optional).")
271+
sys.stderr.write("Cython is not installed. Not compiling core driver files as extensions (optional).")
272272

273273
if "--no-extensions" in sys.argv:
274274
extensions = []
@@ -290,14 +290,25 @@ def run_setup(extensions):
290290
===============================================================================
291291
"""
292292

293+
pypy_unsupported_msg = \
294+
"""
295+
=================================================================================
296+
Some optional C extensions are not supported in PyPy. Only murmur3 will be built.
297+
=================================================================================
298+
"""
299+
293300
if extensions:
294-
if (sys.platform.startswith("java")
295-
or sys.platform == "cli"):
301+
if "PyPy" in sys.version:
302+
sys.stderr.write(pypy_unsupported_msg)
303+
extensions = [ext for ext in extensions if ext is murmur3_ext]
304+
305+
if (sys.platform.startswith("java") or sys.platform == "cli"):
296306
sys.stderr.write(platform_unsupported_msg)
297-
extensions = ()
307+
extensions = []
298308
elif sys.byteorder == "big":
299309
sys.stderr.write(arch_unsupported_msg)
300-
extensions = ()
310+
extensions = []
311+
301312

302313
while True:
303314
# try to build as many of the extensions as we can

0 commit comments

Comments
 (0)