Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c868d16

Browse files
committed
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.
1 parent a71319e commit c868d16

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Doc/tools/mkhowto

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,17 +525,19 @@ class Job:
525525
self.warning(
526526
"Session transcript and error messages are in %s."
527527
% self.log_filename)
528+
result = 1
528529
if hasattr(os, "WIFEXITED"):
529530
if os.WIFEXITED(rc):
530-
self.warning("Exited with status %s." % os.WEXITSTATUS(rc))
531+
result = os.WEXITSTATUS(rc)
532+
self.warning("Exited with status %s." % result)
531533
else:
532534
self.warning("Killed by signal %s." % os.WSTOPSIG(rc))
533535
else:
534536
self.warning("Return code: %s" % rc)
535537
sys.stderr.write("The relevant lines from the transcript are:\n")
536538
sys.stderr.write("-" * 72 + "\n")
537539
sys.stderr.writelines(get_run_transcript(self.log_filename))
538-
sys.exit(rc)
540+
sys.exit(result)
539541

540542
def message(self, msg):
541543
msg = "+++ " + msg

0 commit comments

Comments
 (0)