fix for distutils changes in upcoming Py2.7 and Py3.2
authorLisandro Dalcin <dalcinl@gmail.com>
Wed, 14 Oct 2009 21:11:17 +0000 (18:11 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Wed, 14 Oct 2009 21:11:17 +0000 (18:11 -0300)
runtests.py

index 5d33f9a1ceb1b0198f4322d379f07bf3e4f2ce76..efb4d4216654a53850d45eb5128690a665718f67 100644 (file)
@@ -59,7 +59,11 @@ class build_ext(_build_ext):
     def build_extension(self, ext):
         if ext.language == 'c++':
             try:
-                self.compiler.compiler_so.remove('-Wstrict-prototypes')
+                try: # Py2.7+ & Py3.2+ 
+                    compiler_obj = self.compiler_obj
+                except AttributeError:
+                    compiler_obj = self.compiler
+                compiler_obj.compiler_so.remove('-Wstrict-prototypes')
             except Exception:
                 pass
         _build_ext.build_extension(self, ext)