Skip to content

Commit caab302

Browse files
[3.14] gh-144652: Support Windows exit status in support get_signal_name() (GH-144653) (#144658)
gh-144652: Support Windows exit status in support get_signal_name() (GH-144653) Format Windows exit status as hexadecimal. (cherry picked from commit b121dc4) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 2abaf12 commit caab302

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Lib/test/support/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,6 +3034,10 @@ def get_signal_name(exitcode):
30343034
except KeyError:
30353035
pass
30363036

3037+
# Format Windows exit status as hexadecimal
3038+
if 0xC0000000 <= exitcode:
3039+
return f"0x{exitcode:X}"
3040+
30373041
return None
30383042

30393043
class BrokenIter:

Lib/test/test_support.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ def test_get_signal_name(self):
778778
(128 + int(signal.SIGABRT), 'SIGABRT'),
779779
(3221225477, "STATUS_ACCESS_VIOLATION"),
780780
(0xC00000FD, "STATUS_STACK_OVERFLOW"),
781+
(0xC0000906, "0xC0000906"),
781782
):
782783
self.assertEqual(support.get_signal_name(exitcode), expected,
783784
exitcode)

0 commit comments

Comments
 (0)