Skip to content

Commit e7c98f0

Browse files
authored
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.
1 parent 9a679a0 commit e7c98f0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix ``which.py`` script exit code: it now uses
2+
:func:`os.waitstatus_to_exitcode` to convert :func:`os.system` exit status
3+
into an exit code.

Tools/scripts/which.py

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def main():
4949
msg(filename + ': not executable')
5050
if longlist:
5151
sts = os.system('ls ' + longlist + ' ' + filename)
52+
sts = os.waitstatus_to_exitcode(sts)
5253
if sts: msg('"ls -l" exit status: ' + repr(sts))
5354
if not ident:
5455
msg(prog + ': not found')

0 commit comments

Comments
 (0)