Edgewall Software

Changeset 789

Show
Ignore:
Timestamp:
01/10/2008 01:56:05 AM (11 months ago)
Author:
athomas
Message:

Ignore missing compiler errors on Windows. Fixes #174 and #165.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/setup.py

    r715 r789  
    1515from distutils.cmd import Command 
    1616from distutils.command.build_ext import build_ext 
    17 from distutils.errors import CCompilerError 
     17from distutils.errors import CCompilerError, DistutilsPlatformError 
    1818import doctest 
    1919from glob import glob 
     
    3535class optional_build_ext(build_ext): 
    3636    # This class allows C extension building to fail. 
     37    def run(self): 
     38        try: 
     39            build_ext.run(self) 
     40        except DistutilsPlatformError: 
     41            self._unavailable() 
     42 
    3743    def build_extension(self, ext): 
    3844        try: 
    3945            build_ext.build_extension(self, ext) 
    4046        except CCompilerError, x: 
    41             print '*' * 70 
    42             print """WARNING: 
     47            self._unavailable() 
     48 
     49    def _unavailable(self): 
     50        print '*' * 70 
     51        print """WARNING: 
    4352An optional C extension could not be compiled, speedups will not be 
    4453available.""" 
    45             print '*' * 70 
     54        print '*' * 70 
    4655 
    4756