mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
When an external application we use exits normally, exit with the same
exit code they returned. All other types of exit from child processes are normalized to a return code of 1. Closes SF bug #732143.
This commit is contained in:
parent
a71319eebb
commit
c868d16e11
1 changed files with 4 additions and 2 deletions
|
@ -525,9 +525,11 @@ class Job:
|
||||||
self.warning(
|
self.warning(
|
||||||
"Session transcript and error messages are in %s."
|
"Session transcript and error messages are in %s."
|
||||||
% self.log_filename)
|
% self.log_filename)
|
||||||
|
result = 1
|
||||||
if hasattr(os, "WIFEXITED"):
|
if hasattr(os, "WIFEXITED"):
|
||||||
if os.WIFEXITED(rc):
|
if os.WIFEXITED(rc):
|
||||||
self.warning("Exited with status %s." % os.WEXITSTATUS(rc))
|
result = os.WEXITSTATUS(rc)
|
||||||
|
self.warning("Exited with status %s." % result)
|
||||||
else:
|
else:
|
||||||
self.warning("Killed by signal %s." % os.WSTOPSIG(rc))
|
self.warning("Killed by signal %s." % os.WSTOPSIG(rc))
|
||||||
else:
|
else:
|
||||||
|
@ -535,7 +537,7 @@ class Job:
|
||||||
sys.stderr.write("The relevant lines from the transcript are:\n")
|
sys.stderr.write("The relevant lines from the transcript are:\n")
|
||||||
sys.stderr.write("-" * 72 + "\n")
|
sys.stderr.write("-" * 72 + "\n")
|
||||||
sys.stderr.writelines(get_run_transcript(self.log_filename))
|
sys.stderr.writelines(get_run_transcript(self.log_filename))
|
||||||
sys.exit(rc)
|
sys.exit(result)
|
||||||
|
|
||||||
def message(self, msg):
|
def message(self, msg):
|
||||||
msg = "+++ " + msg
|
msg = "+++ " + msg
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue