Commit 998d8c7d authored by Tres Seaver's avatar Tres Seaver

Allow suppressing C extensions via PURE_PYTHON environment variable.

parent c84a9aa0
...@@ -93,13 +93,14 @@ def BTreeExtension(family): ...@@ -93,13 +93,14 @@ def BTreeExtension(family):
return Extension(name, sources, **kwargs) return Extension(name, sources, **kwargs)
py_impl = getattr(platform, 'python_implementation', lambda: None) py_impl = getattr(platform, 'python_implementation', lambda: None)
pure_python = os.environ.get('PURE_PYTHON', False)
is_pypy = py_impl() == 'PyPy' is_pypy = py_impl() == 'PyPy'
is_jython = 'java' in sys.platform is_jython = 'java' in sys.platform
# Jython cannot build the C optimizations, while on PyPy they are # Jython cannot build the C optimizations, while on PyPy they are
# anti-optimizations (the C extension compatibility layer is known-slow, # anti-optimizations (the C extension compatibility layer is known-slow,
# and defeats JIT opportunities). # and defeats JIT opportunities).
if is_pypy or is_jython or sys.version_info[0] > 2: if pure_python or is_pypy or is_jython or sys.version_info[0] > 2:
ext_modules = [] ext_modules = []
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment