[pypy-svn] r49633 - in pypy/dist/pypy: rpython/tool translator/c translator/tool

arigo at codespeak.net arigo at codespeak.net
Tue Dec 11 17:50:46 CET 2007


Author: arigo
Date: Tue Dec 11 17:50:46 2007
New Revision: 49633

Modified:
   pypy/dist/pypy/rpython/tool/rfficache.py
   pypy/dist/pypy/translator/c/genc.py
   pypy/dist/pypy/translator/tool/cbuild.py
Log:
Fix broken calls to build_executable() leading to a TypeError masked by
a bare "except:".  Remove the two bare "except:" while I'm at it.  This
means that some tests will run again - they were skipped by mistake.


Modified: pypy/dist/pypy/rpython/tool/rfficache.py
==============================================================================
--- pypy/dist/pypy/rpython/tool/rfficache.py	(original)
+++ pypy/dist/pypy/rpython/tool/rfficache.py	Tue Dec 11 17:50:46 2007
@@ -5,8 +5,7 @@
 import py
 import os
 import distutils
-from pypy.translator.tool.cbuild import build_executable, \
-     ExternalCompilationInfo
+from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.tool.udir import udir
 from pypy.tool.autopath import pypydir
 from pypy.rlib import rarithmetic

Modified: pypy/dist/pypy/translator/c/genc.py
==============================================================================
--- pypy/dist/pypy/translator/c/genc.py	(original)
+++ pypy/dist/pypy/translator/c/genc.py	Tue Dec 11 17:50:46 2007
@@ -8,7 +8,7 @@
 from pypy.translator.gensupp import uniquemodulename, NameManager
 from pypy.translator.tool.cbuild import so_ext, ExternalCompilationInfo
 from pypy.translator.tool.cbuild import compile_c_module
-from pypy.translator.tool.cbuild import build_executable, CCompiler, ProfOpt
+from pypy.translator.tool.cbuild import CCompiler, ProfOpt
 from pypy.translator.tool.cbuild import import_module_from_directory
 from pypy.translator.tool.cbuild import check_under_under_thread
 from pypy.rpython.lltypesystem import lltype

Modified: pypy/dist/pypy/translator/tool/cbuild.py
==============================================================================
--- pypy/dist/pypy/translator/tool/cbuild.py	(original)
+++ pypy/dist/pypy/translator/tool/cbuild.py	Tue Dec 11 17:50:46 2007
@@ -458,6 +458,7 @@
     return str(compiler.outputfilename)
 
 def check_boehm_presence():
+    import distutils.errors
     from pypy.tool.udir import udir
     try:
         cfile = udir.join('check_boehm.c')
@@ -472,15 +473,18 @@
 """)
         cfile.close()
         if sys.platform == 'win32':
-            build_executable([cfname], libraries=['gc_pypy'], noerr=True)
+            eci = ExternalCompilationInfo(libraries=['gc_pypy'])
         else:
-            build_executable([cfname], libraries=['gc'], noerr=True)
-    except:
+            eci = ExternalCompilationInfo(libraries=['gc'])
+        build_executable([cfname], eci, noerr=True)
+    except (distutils.errors.CompileError,
+            distutils.errors.LinkError):
         return False
     else:
         return True
 
 def check_under_under_thread():
+    import distutils.errors
     from pypy.tool.udir import udir
     cfile = py.path.local(autopath.this_dir).join('__thread_test.c')
     fsource = cfile.open('r')
@@ -491,12 +495,12 @@
     fsource.write(source)
     fsource.close()
     try:
-       exe = build_executable([str(cfile)], 
+       exe = build_executable([str(cfile)], ExternalCompilationInfo(),
                               noerr=True)
        py.process.cmdexec(exe)
-    except (KeyboardInterrupt, SystemExit):
-        raise
-    except:
+    except (distutils.errors.CompileError,
+            distutils.errors.LinkError,
+            py.error.Error):
         return False
     else:
         return True



More information about the Pypy-commit mailing list