File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -698,6 +698,14 @@ def get_signal_name(exitcode):
698698 except ValueError :
699699 pass
700700
701+ # Shell exit code (ex: WASI build)
702+ if 128 < exitcode < 256 :
703+ signum = exitcode - 128
704+ try :
705+ return signal .Signals (signum ).name
706+ except ValueError :
707+ pass
708+
701709 try :
702710 return WINDOWS_STATUS [exitcode ]
703711 except KeyError :
Original file line number Diff line number Diff line change @@ -2291,6 +2291,7 @@ def test_get_signal_name(self):
22912291 for exitcode , expected in (
22922292 (- int (signal .SIGINT ), 'SIGINT' ),
22932293 (- int (signal .SIGSEGV ), 'SIGSEGV' ),
2294+ (128 + int (signal .SIGABRT ), 'SIGABRT' ),
22942295 (3221225477 , "STATUS_ACCESS_VIOLATION" ),
22952296 (0xC00000FD , "STATUS_STACK_OVERFLOW" ),
22962297 ):
You can’t perform that action at this time.
0 commit comments