From 0a00f725323b0137a49561afb481f96c3b66c52b Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 24 Jan 2009 15:58:35 +0100 Subject: [PATCH] prevent pyxbuild.py from raising SystemExit (!) on build failure --- pyximport/pyxbuild.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyximport/pyxbuild.py b/pyximport/pyxbuild.py index b7e032b6..c38ca47c 100644 --- a/pyximport/pyxbuild.py +++ b/pyximport/pyxbuild.py @@ -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") -- 2.26.2