Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-144652: Support Windows exit status in support get_signal_name() (G…
…H-144653)

Format Windows exit status as hexadecimal.
(cherry picked from commit b121dc4)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
vstinner authored and miss-islington committed Feb 10, 2026
commit 4eb77979893ad153b8ac2b97f8a1673337976f45
4 changes: 4 additions & 0 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3034,6 +3034,10 @@ def get_signal_name(exitcode):
except KeyError:
pass

# Format Windows exit status as hexadecimal
if 0xC0000000 <= exitcode:
return f"0x{exitcode:X}"

return None

class BrokenIter:
Expand Down
1 change: 1 addition & 0 deletions Lib/test/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ def test_get_signal_name(self):
(128 + int(signal.SIGABRT), 'SIGABRT'),
(3221225477, "STATUS_ACCESS_VIOLATION"),
(0xC00000FD, "STATUS_STACK_OVERFLOW"),
(0xC0000906, "0xC0000906"),
):
self.assertEqual(support.get_signal_name(exitcode), expected,
exitcode)
Expand Down
Loading