Update to pymake tip to pick up bug 700203.

This commit is contained in:
Kyle Huey 2011-11-06 21:53:30 -05:00
parent c6717e54c4
commit 17b2ee39cf
3 changed files with 20 additions and 4 deletions

View File

@ -215,9 +215,13 @@ class PythonJob(Job):
print >>sys.stderr, e print >>sys.stderr, e
return e.exitcode return e.exitcode
except: except:
print >>sys.stderr, sys.exc_info()[1] e = sys.exc_info()[1]
print >>sys.stderr, traceback.print_exc() if isinstance(e, SystemExit) and e.code == '0':
return -127 pass # sys.exit(0) is not a failure
else:
print >>sys.stderr, e
print >>sys.stderr, traceback.print_exc()
return -127
finally: finally:
os.environ = oldenv os.environ = oldenv
return 0 return 0

View File

@ -0,0 +1,8 @@
#T gmake skip
CMD = %pycmd asplode
PYCOMMANDPATH = $(TESTPATH) $(TESTPATH)/subdir
all:
$(CMD) 0
@echo TEST-PASS

View File

@ -1,4 +1,4 @@
import os import os, sys
def writetofile(args): def writetofile(args):
with open(args[0], 'w') as f: with open(args[0], 'w') as f:
@ -7,3 +7,7 @@ def writetofile(args):
def writeenvtofile(args): def writeenvtofile(args):
with open(args[0], 'w') as f: with open(args[0], 'w') as f:
f.write(os.environ[args[1]]) f.write(os.environ[args[1]])
def asplode(args):
sys.exit(args[0])
return 0