3 from distutils.errors import (CCompilerError, DistutilsExecError,
4 DistutilsPlatformError)
6 from setuptools.command.build_ext import build_ext
7 from pkg_resources import (normalize_path, working_set,
8 add_activation_listener, require)
10 raise RuntimeError("zope.interface requires Distribute under Python 3. "
11 "See http://packages.python.org/distribute")
13 class optional_build_ext(build_ext):
14 """This class subclasses build_ext and allows
15 the building of C extensions to fail.
21 except DistutilsPlatformError as e:
24 def build_extension(self, ext):
26 build_ext.build_extension(self, ext)
28 except (CCompilerError, DistutilsExecError) as e:
31 def _unavailable(self, e):
32 print('*' * 80, file=sys.stderr)
35 An optional code optimization (C extension) could not be compiled.
37 Optimizations for this package will not be available!""", file=sys.stderr)
38 print(file=sys.stderr)
39 print(e, file=sys.stderr)
40 print('*' * 80, file=sys.stderr)