Commit 0a00f725 authored by Stefan Behnel's avatar Stefan Behnel

prevent pyxbuild.py from raising SystemExit (!) on build failure

parent f84b2a99
...@@ -23,7 +23,7 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0): ...@@ -23,7 +23,7 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0):
if not ext: if not ext:
modname, extension = os.path.splitext(name) modname, extension = os.path.splitext(name)
assert extension == ".pyx", extension assert extension in (".pyx", ".py"), extension
ext = Extension(name=modname, sources=[filename]) ext = Extension(name=modname, sources=[filename])
if DEBUG: if DEBUG:
...@@ -64,14 +64,14 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0): ...@@ -64,14 +64,14 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0):
sys.stderr.write(error + "\n") sys.stderr.write(error + "\n")
raise raise
else: else:
raise SystemExit, error raise RuntimeError, error
except (DistutilsError, except (DistutilsError,
CCompilerError), msg: CCompilerError), msg:
if DEBUG: if DEBUG:
raise raise
else: else:
raise SystemExit, "error: " + str(msg) raise RuntimeError, "error: " + str(msg)
if __name__=="__main__": if __name__=="__main__":
pyx_to_dll("dummy.pyx") pyx_to_dll("dummy.pyx")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment