diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-20 07:02:36 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-20 07:02:36 -0500 |
commit | 2827bb6e678c1233fc8d54961a39c37c3d78b908 (patch) | |
tree | 6b749001ff88fa017b94bed041443fcb21d9f0ba /setup.py | |
parent | 741e21203b77547906babf0f04edf7eb5dedf723 (diff) | |
parent | fc38bf8526cb1717968a1958439da5fae4768375 (diff) | |
download | python-coveragepy-git-2827bb6e678c1233fc8d54961a39c37c3d78b908.tar.gz |
Merged
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -40,11 +40,11 @@ Topic :: Software Development :: Testing import os, sys from setuptools import setup -from distutils.core import Extension # pylint: disable=E0611,F0401 -from distutils.command.build_ext import build_ext -from distutils.errors import ( - CCompilerError, DistutilsExecError, DistutilsPlatformError - ) +from distutils.core import Extension # pylint: disable=E0611,F0401 +from distutils.command import build_ext # pylint: disable=E0611,F0401 +from distutils.errors import CCompilerError # pylint: disable=E0611,F0401,C0301 +from distutils.errors import DistutilsExecError # pylint: disable=E0611,F0401,C0301 +from distutils.errors import DistutilsPlatformError # pylint: disable=E0611,F0401,C0301 # Get or massage our metadata. We exec coverage/version.py so we can avoid # importing the product code into setup.py. @@ -114,29 +114,30 @@ setup_args = dict( ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError) if sys.platform == 'win32' and sys.version_info > (2, 6): - # 2.6's distutils.msvc9compiler can raise an IOError when failing to - # find the compiler - ext_errors += (IOError,) + # 2.6's distutils.msvc9compiler can raise an IOError when failing to + # find the compiler + ext_errors += (IOError,) class BuildFailed(Exception): """Raise this to indicate the C extension wouldn't build.""" def __init__(self): + Exception.__init__() self.cause = sys.exc_info()[1] # work around py 2/3 different syntax -class ve_build_ext(build_ext): +class ve_build_ext(build_ext.build_ext): """Build C extensions, but fail with a straightforward exception.""" def run(self): """Wrap `run` with `BuildFailed`.""" try: - build_ext.run(self) + build_ext.build_ext.run(self) except DistutilsPlatformError: raise BuildFailed() def build_extension(self, ext): """Wrap `build_extension` with `BuildFailed`.""" try: - build_ext.build_extension(self, ext) + build_ext.build_ext.build_extension(self, ext) except ext_errors: raise BuildFailed() except ValueError: |