prevent pyxbuild.py from raising SystemExit (!) on build failure
authorStefan Behnel <scoder@users.berlios.de>
Sat, 24 Jan 2009 14:58:35 +0000 (15:58 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 24 Jan 2009 14:58:35 +0000 (15:58 +0100)
pyximport/pyxbuild.py

index b7e032b6bc8dc4e9ce31d2139a7297e68cdc6658..c38ca47c62a8a0289458a3eb22feed3a953b8f7d 100644 (file)
@@ -23,7 +23,7 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0):
 
     if not ext:
         modname, extension = os.path.splitext(name)
-       assert extension == ".pyx", extension
+       assert extension in (".pyx", ".py"), extension
         ext = Extension(name=modname, sources=[filename])
 
     if DEBUG:
@@ -64,14 +64,14 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0):
             sys.stderr.write(error + "\n")
             raise
         else:
-            raise SystemExit, error
+            raise RuntimeError, error
 
     except (DistutilsError,
         CCompilerError), msg:
         if DEBUG:
             raise
         else:
-            raise SystemExit, "error: " + str(msg)
+            raise RuntimeError, "error: " + str(msg)
 
 if __name__=="__main__":
     pyx_to_dll("dummy.pyx")