From: Mayne, P. <pet...@hp...> - 2009-08-18 11:09:25
|
Mercurial contains the code below. None of the W* attributes are present in Jython. def explain_exit(code): """return a 2-tuple (desc, code) describing a process's status""" if os.WIFEXITED(code): val = os.WEXITSTATUS(code) return _("exited with status %d") % val, val elif os.WIFSIGNALED(code): val = os.WTERMSIG(code) return _("killed by signal %d") % val, val elif os.WIFSTOPPED(code): val = os.WSTOPSIG(code) return _("stopped by signal %d") % val, val raise ValueError(_("invalid exit code")) Is it possible to implement these in Jython? If not, the fallback position for applications would be to implement the Windows version of the function. def explain_exit(code): return _("exited with status %d") % code, code :-) PJDM -- Peter Mayne Hewlett-Packard Canberra, ACT, Australia |