# HG changeset patch # User athomas # Date 1199926565 0 # Node ID ae54722b00d1fee776693cb373da4dbeeb24f918 # Parent 571226acaeff9b7c7bb475b1a1f07c3846523c1d Ignore missing compiler errors on Windows. Fixes #174 and #165. diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from distutils.cmd import Command from distutils.command.build_ext import build_ext -from distutils.errors import CCompilerError +from distutils.errors import CCompilerError, DistutilsPlatformError import doctest from glob import glob import os @@ -34,15 +34,24 @@ class optional_build_ext(build_ext): # This class allows C extension building to fail. + def run(self): + try: + build_ext.run(self) + except DistutilsPlatformError: + self._unavailable() + def build_extension(self, ext): try: build_ext.build_extension(self, ext) except CCompilerError, x: - print '*' * 70 - print """WARNING: + self._unavailable() + + def _unavailable(self): + print '*' * 70 + print """WARNING: An optional C extension could not be compiled, speedups will not be available.""" - print '*' * 70 + print '*' * 70 if Feature: