[Checkins] SVN: BTrees/branches/pure_python/ Allow suppressing C extensions via PURE_PYTHON environment variable.

Tres Seaver cvs-admin at zope.org
Mon Oct 22 14:28:09 UTC 2012


Log message for revision 128124:
  Allow suppressing C extensions via PURE_PYTHON environment variable.

Changed:
  _U  BTrees/branches/pure_python/
  U   BTrees/branches/pure_python/setup.py

-=-
Modified: BTrees/branches/pure_python/setup.py
===================================================================
--- BTrees/branches/pure_python/setup.py	2012-10-22 12:48:53 UTC (rev 128123)
+++ BTrees/branches/pure_python/setup.py	2012-10-22 14:28:05 UTC (rev 128124)
@@ -93,13 +93,14 @@
     return Extension(name, sources, **kwargs)
 
 py_impl = getattr(platform, 'python_implementation', lambda: None)
+pure_python = os.environ.get('PURE_PYTHON', False)
 is_pypy = py_impl() == 'PyPy'
 is_jython = 'java' in sys.platform
 
 # Jython cannot build the C optimizations, while on PyPy they are
 # anti-optimizations (the C extension compatibility layer is known-slow,
 # 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 = []
 else:
 



More information about the checkins mailing list