mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Gracefully handle missing 'terminated' and 'exited' events on ptvsd exit regardless of Python version - also happens on 2.x sometimes.
This commit is contained in:
parent
75fc537656
commit
c0cb53227e
1 changed files with 3 additions and 4 deletions
|
|
@ -196,10 +196,9 @@ class DebugSession(object):
|
|||
def wait_for_termination(self, expected_returncode=0):
|
||||
print(colors.LIGHT_MAGENTA + 'Waiting for ptvsd#%d to terminate' % self.ptvsd_port + colors.RESET)
|
||||
|
||||
if sys.version_info < (3,):
|
||||
# On 3.x, ptvsd sometimes exits without sending this, likely due to
|
||||
# https://github.com/Microsoft/ptvsd/issues/530
|
||||
self.wait_for_next(Event('terminated'))
|
||||
# BUG: ptvsd sometimes exits without sending 'terminate' or 'exited', likely due to
|
||||
# https://github.com/Microsoft/ptvsd/issues/530. So rather than wait for them, wait until
|
||||
# we disconnect, then check those events for proper body only if they're actually present.
|
||||
|
||||
self.wait_for_disconnect(close=False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue