1 Commits

Author SHA1 Message Date
2e9ec63675 Don't catch SystemExit from a subprocess 2013-07-09 13:15:27 -04:00
2 changed files with 2 additions and 1 deletions

View File

@@ -173,7 +173,7 @@ def _exec_user_code(codeargs): # pragma: no cover (runs in subprocess)
codeobj = compile(code, '<user-code>', 'exec',
flags = 0, dont_inherit = 1)
exec(codeobj, module.__dict__, {})
except:
except Exception:
try:
# Pull out the exception
info = sys.exc_info()

View File

@@ -307,6 +307,7 @@ class TestClient(object):
code=textwrap.dedent("""
import sys
print sys.argv[1].encode('ascii'), sys.argv[2]
sys.exit(0) # also test raising SystemExit
""")
status = do(code, ["hello", 123], False)
eq_(status["log"], "hello 123\n")