diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2011-07-20 09:51:43 +0200 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2011-07-20 09:51:43 +0200 |
commit | 515ec279a31168272c9f32d24f11735b69eb3217 (patch) | |
tree | 132fdae8fc89a5ff4a0807b8e998aee048d01551 /setup.py | |
parent | 178f60584374bfc10ac257c74bcc2c36dffff7c9 (diff) | |
download | markupsafe-0.13.tar.gz |
Do not attempt to compile extensions for pypy and jython. This fixes #40.13
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 41 |
1 files changed, 26 insertions, 15 deletions
@@ -9,6 +9,9 @@ from distutils.errors import CCompilerError, DistutilsExecError, \ # fail safe compilation shamelessly stolen from the simplejson # setup.py file. Original author: Bob Ippolito +is_jython = 'java' in sys.platform +is_pypy = hasattr(sys, 'pypy_version_info') + speedups = Feature( 'optional C speed-enhancement module', @@ -92,21 +95,29 @@ def run_setup(with_binary): ) -try: - run_setup(True) -except BuildFailed: - LINE = '=' * 74 - BUILD_EXT_WARNING = 'WARNING: The C extension could not be compiled, speedups are not enabled.' +def try_building_extension(): + try: + run_setup(True) + except BuildFailed: + LINE = '=' * 74 + BUILD_EXT_WARNING = 'WARNING: The C extension could not be ' \ + 'compiled, speedups are not enabled.' + + echo(LINE) + echo(BUILD_EXT_WARNING) + echo('Failure information, if any, is above.') + echo('Retrying the build without the C extension now.') + echo() + + run_setup(False) - echo(LINE) - echo(BUILD_EXT_WARNING) - echo('Failure information, if any, is above.') - echo('Retrying the build without the C extension now.') - echo() + echo(LINE) + echo(BUILD_EXT_WARNING) + echo('Plain-Python installation succeeded.') + echo(LINE) - run_setup(False) - echo(LINE) - echo(BUILD_EXT_WARNING) - echo('Plain-Python installation succeeded.') - echo(LINE) +if not (is_pypy or is_jython): + try_building_extension() +else: + run_setpu(False) |