[Python-checkins] CVS: python/dist/src/Doc/tools mkhowto,1.28,1.29
Fred L. Drake
fdrake@users.sourceforge.net
Fri, 10 Aug 2001 13:17:11 -0700
Update of /cvsroot/python/python/dist/src/Doc/tools
In directory usw-pr-cvs1:/tmp/cvs-serv25333/tools
Modified Files:
mkhowto
Log Message:
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.
Index: mkhowto
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** mkhowto 2001/07/17 14:46:09 1.28
--- mkhowto 2001/08/10 20:17:09 1.29
***************
*** 181,184 ****
--- 181,186 ----
self.global_module_index = arg
elif opt == "--dir":
+ if os.sep == "\\":
+ arg = re.sub("/", "\\", arg)
self.builddir = arg
elif opt == "--paper":
***************
*** 476,485 ****
def run(self, command):
self.message(command)
! rc = os.system("(%s) </dev/null >>%s 2>&1"
! % (command, self.log_filename))
if rc:
self.warning(
"Session transcript and error messages are in %s."
% self.log_filename)
sys.stderr.write("The relevant lines from the transcript are:\n")
sys.stderr.write("-" * 72 + "\n")
--- 478,497 ----
def run(self, command):
self.message(command)
! if sys.platform.startswith("win"):
! rc = os.system(command)
! else:
! rc = os.system("(%s) </dev/null >>%s 2>&1"
! % (command, self.log_filename))
if rc:
self.warning(
"Session transcript and error messages are in %s."
% 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("-" * 72 + "\n")