https://github.com/python/cpython/commit/caab302332988a93437388087ed2a793aaeb4f05
commit: caab302332988a93437388087ed2a793aaeb4f05
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2026-02-10T11:42:26Z
summary:

[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 b121dc434748772272514311fe315e009fdfe6e5)

Co-authored-by: Victor Stinner <[email protected]>

files:
M Lib/test/support/__init__.py
M Lib/test/test_support.py

diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 2d14cade188698..6635ec3474e12e 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -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:
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 27cd5afb390ec3..79f0e2eb29ff4c 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -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)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to