From: Victor Stinner Date: Tue, 10 Feb 2026 11:15:14 +0000 (+0100) Subject: gh-144652: Support Windows exit status in support get_signal_name() (#144653) X-Git-Tag: v3.15.0a6~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b121dc434748772272514311fe315e009fdfe6e5;p=thirdparty%2FPython%2Fcpython.git gh-144652: Support Windows exit status in support get_signal_name() (#144653) Format Windows exit status as hexadecimal. --- diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 66469d088f33..307bac65ae50 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -3116,6 +3116,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 be7e307b4f11..a3129dbcb0a5 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -788,6 +788,7 @@ class TestSupport(unittest.TestCase): (128 + int(signal.SIGABRT), 'SIGABRT'), (3221225477, "STATUS_ACCESS_VIOLATION"), (0xC00000FD, "STATUS_STACK_OVERFLOW"), + (0xC0000906, "0xC0000906"), ): self.assertEqual(support.get_signal_name(exitcode), expected, exitcode)