mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Fix debuggee exit code handling on POSIX.
This commit is contained in:
parent
1262a265b5
commit
c57e48262f
1 changed files with 7 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
|||
import atexit
|
||||
import locale
|
||||
import os
|
||||
import platform
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
|
|
@ -113,6 +114,12 @@ def wait_for_exit():
|
|||
|
||||
try:
|
||||
code = process.wait()
|
||||
if platform.system() != "Windows" and code < 0:
|
||||
# On POSIX, if the process was terminated by a signal, Popen will use
|
||||
# a negative returncode to indicate that - but the actual exit code of
|
||||
# the process is always an unsigned number, and can be determined by
|
||||
# taking the lowest 8 bits of that negative returncode.
|
||||
code &= 0xFF
|
||||
except Exception:
|
||||
log.exception("Couldn't determine process exit code:")
|
||||
code = -1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue