Kaydet (Commit) 1cb560a6 authored tarafından Fred Drake's avatar Fred Drake

Do more to be compatible with Windows/CygWin. Make error messages more

informative when a child process dies with an error.

This is a variation of parts of SF patch #429611.
üst 9443dc31
...@@ -180,6 +180,8 @@ class Options: ...@@ -180,6 +180,8 @@ class Options:
elif opt == "--global-module-index": elif opt == "--global-module-index":
self.global_module_index = arg self.global_module_index = arg
elif opt == "--dir": elif opt == "--dir":
if os.sep == "\\":
arg = re.sub("/", "\\", arg)
self.builddir = arg self.builddir = arg
elif opt == "--paper": elif opt == "--paper":
self.paper = arg self.paper = arg
...@@ -475,12 +477,22 @@ class Job: ...@@ -475,12 +477,22 @@ class Job:
def run(self, command): def run(self, command):
self.message(command) self.message(command)
rc = os.system("(%s) </dev/null >>%s 2>&1" if sys.platform.startswith("win"):
% (command, self.log_filename)) rc = os.system(command)
else:
rc = os.system("(%s) </dev/null >>%s 2>&1"
% (command, self.log_filename))
if rc: if rc:
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)
if hasattr(os, "WIFEXITED"):
if os.WIFEXITED(rc):
self.warning("Exited with status %s." % os.WEXITSTATUS(rc))
else:
self.warning("Killed by signal %s." % os.WSTOPSIG(rc))
else:
self.warning("Return code: %s" % rc)
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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment