]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Added a workaround for Python bug 7511 where
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Jun 2011 15:58:26 +0000 (11:58 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Jun 2011 15:58:26 +0000 (11:58 -0400)
failure of C extension build does not
raise an appropriate exception on Windows 64
bit + VC express [ticket:2184]

CHANGES
setup.py

diff --git a/CHANGES b/CHANGES
index 2014abf94e309c4b876e7c505a647dc17cb68e18..3c7bcd3d4d486adc5abba24272af4f8d5ece855a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,12 @@ CHANGES
 =======
 0.7.1
 =====
+- general
+  - 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]
+
 - orm
   - "delete-orphan" cascade is now allowed on
     self-referential relationships - this since
index fb896972aed68134ff4cde402e8869b2541291bf..58c9c8782e092f6dca3ed3b0b0ffb6909b173fd6 100644 (file)
--- 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