summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-06-05 11:58:26 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-06-05 11:58:26 -0400
commitdc75e0c6835ea53d6a84cfbf819240da2286486d (patch)
tree8e403d4cd035320fe716f261e8a690743819a94d /setup.py
parenteae80bb046e08afe395ccf82b561f0cbbec443ff (diff)
downloadsqlalchemy-dc75e0c6835ea53d6a84cfbf819240da2286486d.tar.gz
- Added a workaround for Python bug 7511 where
failure of C extension build does not raise an appropriate exception on Windows 64 bit + VC express [ticket:2184]
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index fb896972a..58c9c8782 100644
--- a/setup.py
+++ b/setup.py
@@ -51,14 +51,11 @@ ext_modules = [
sources=['lib/sqlalchemy/cextension/resultproxy.c'])
]
+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 = (
- CCompilerError, DistutilsExecError,
- DistutilsPlatformError, IOError)
-else:
- ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
+ ext_errors += (IOError,)
class BuildFailed(Exception):
@@ -79,6 +76,11 @@ class ve_build_ext(build_ext):
build_ext.build_extension(self, ext)
except ext_errors:
raise BuildFailed()
+ except ValueError:
+ # this can happen on Windows 64 bit, see Python issue 7511
+ if "'path'" in str(sys.exc_info()[1]): # works with both py 2/3
+ raise BuildFailed()
+ raise
cmdclass['build_ext'] = ve_build_ext