bpo-40094: Fix which.py script exit code (GH-19286)
It now uses os.waitstatus_to_exitcode() to convert os.system() exit status into an exit code.
This commit is contained in:
parent
9a679a0e47
commit
e7c98f08e2
|
@ -0,0 +1,3 @@
|
||||||
|
Fix ``which.py`` script exit code: it now uses
|
||||||
|
:func:`os.waitstatus_to_exitcode` to convert :func:`os.system` exit status
|
||||||
|
into an exit code.
|
|
@ -49,6 +49,7 @@ def main():
|
||||||
msg(filename + ': not executable')
|
msg(filename + ': not executable')
|
||||||
if longlist:
|
if longlist:
|
||||||
sts = os.system('ls ' + longlist + ' ' + filename)
|
sts = os.system('ls ' + longlist + ' ' + filename)
|
||||||
|
sts = os.waitstatus_to_exitcode(sts)
|
||||||
if sts: msg('"ls -l" exit status: ' + repr(sts))
|
if sts: msg('"ls -l" exit status: ' + repr(sts))
|
||||||
if not ident:
|
if not ident:
|
||||||
msg(prog + ': not found')
|
msg(prog + ': not found')
|
||||||
|
|
Loading…
Reference in New Issue