[pypy-svn] r38145 - pypy/dist/pypy/translator/goal
pedronis at codespeak.net
pedronis at codespeak.net
Thu Feb 8 15:27:26 CET 2007
Author: pedronis
Date: Thu Feb 8 15:27:23 2007
New Revision: 38145
Modified:
pypy/dist/pypy/translator/goal/app_main.py
Log:
exit with status 1 if raising an exception, this makes py.test -C report failures correctly.
Modified: pypy/dist/pypy/translator/goal/app_main.py
==============================================================================
--- pypy/dist/pypy/translator/goal/app_main.py (original)
+++ pypy/dist/pypy/translator/goal/app_main.py Thu Feb 8 15:27:23 2007
@@ -225,17 +225,19 @@
if hasattr(signal, "SIGPIPE"):
signal.signal(signal.SIGPIPE, signal.SIG_IGN)
+ success = True
+
try:
if sys.argv:
if run_command:
cmd = sys.argv.pop(1)
def run_it():
exec cmd in mainmodule.__dict__
- run_toplevel(run_it)
+ success = run_toplevel(run_it)
else:
scriptdir = resolvedirof(sys.argv[0])
sys.path.insert(0, scriptdir)
- run_toplevel(execfile, sys.argv[0], mainmodule.__dict__)
+ success = run_toplevel(execfile, sys.argv[0], mainmodule.__dict__)
else:
sys.argv.append('')
go_interactive = True
@@ -243,11 +245,11 @@
print >> sys.stderr, "debug: importing code"
import code
print >> sys.stderr, "debug: calling code.interact()"
- run_toplevel(code.interact, local=mainmodule.__dict__)
+ success = run_toplevel(code.interact, local=mainmodule.__dict__)
except SystemExit, e:
return e.code
else:
- return 0
+ return not success
def resolvedirof(filename):
try:
More information about the Pypy-commit
mailing list