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
Родитель a3c088eb23
Коммит 10a557c105
3 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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

Просмотреть файл

@ -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])