From 05dd78ed22cc997d7481683cab012b73bf5d710a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 17 Dec 2012 08:49:56 -0500 Subject: pylint tweaks to setup.py --- setup.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index c62589c4..435ad242 100644 --- a/setup.py +++ b/setup.py @@ -40,9 +40,9 @@ 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 ( +from distutils.core import Extension # pylint: disable=E0611,F0401 +from distutils.command import build_ext # pylint: disable=E0611,F0401 +from distutils.errors import ( # pylint: disable=E0611,F0401 CCompilerError, DistutilsExecError, DistutilsPlatformError ) @@ -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: -- cgit v1.2.1 From fc38bf8526cb1717968a1958439da5fae4768375 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 19 Dec 2012 21:20:29 -0500 Subject: Retro-fit onto 2.3 and 2.4 again. --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 435ad242..53f08f9b 100644 --- a/setup.py +++ b/setup.py @@ -42,9 +42,9 @@ import os, sys from setuptools import setup from distutils.core import Extension # pylint: disable=E0611,F0401 from distutils.command import build_ext # pylint: disable=E0611,F0401 -from distutils.errors import ( # pylint: disable=E0611,F0401 - CCompilerError, DistutilsExecError, DistutilsPlatformError - ) +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. -- cgit v1.2.1