From: Peter M. <re...@bu...> - 2009-08-19 08:44:56
|
New submission from Peter Mayne <Pet...@hp...>: Mercurial contains the code below for Posix platforms. None of the os.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")) Frank Wierzbicki says: "I would say that (for now) acting like being on Jython has the same disadvantages as being on Windows is the right approach, after all, it could be on Windows, and it is inconvenient to check for Windows from Jython." This seems sensible to me, so a "wont fix"/"rejected" resolution would be fine if this is not reasonable for Jython. For future reference in case of a "wont fix"/"rejected", the workaround that Mercurial uses on Windows is: def explain_exit(code): return _("exited with status %d") % code, code ---------- components: Library messages: 5058 nosy: pjdm severity: normal status: open title: No os.W* attributes versions: 2.5.0 _______________________________________ Jython tracker <re...@bu...> <http://bugs.jython.org/issue1442> _______________________________________ |