Bug 788971 - Pymake chokes when native commands raise exceptions without a "code" attribute. r=ted

This commit is contained in:
Siddharth Agarwal 2012-09-08 02:54:05 +05:30
parent afc84f088e
commit 94d899b9ce
3 changed files with 14 additions and 2 deletions

View File

@ -264,8 +264,8 @@ class PythonJob(Job):
pass # sys.exit(0) is not a failure
else:
print >>sys.stderr, e
print >>sys.stderr, traceback.print_exc()
return (e.code if isinstance(e.code, int) else 1)
traceback.print_exc()
return -127
finally:
os.environ.clear()
os.environ.update(oldenv)

View File

@ -0,0 +1,9 @@
#T gmake skip
#T returncode: 2
#T grep-for: "Exception: info-exception"
CMD = %pycmd asplode_raise
PYCOMMANDPATH = $(TESTPATH) $(TESTPATH)/subdir
all:
@$(CMD) info-exception

View File

@ -30,3 +30,6 @@ def asplode(args):
def asplode_return(args):
arg0 = convertasplode(args[0])
return arg0
def asplode_raise(args):
raise Exception(args[0])