mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Suppress warning on exit by properly closing pydevd socket (#1826)
* Fix #1812, first try * Prevent tries to close socket multiple times
This commit is contained in:
parent
4c226dd7e9
commit
fb0b06cab1
1 changed files with 7 additions and 0 deletions
|
|
@ -726,6 +726,8 @@ class PyDB(object):
|
|||
|
||||
self._local_thread_trace_func = threading.local()
|
||||
|
||||
self._client_socket = None
|
||||
|
||||
self._server_socket_ready_event = ThreadingEvent()
|
||||
self._server_socket_name = None
|
||||
|
||||
|
|
@ -1504,6 +1506,7 @@ class PyDB(object):
|
|||
def connect(self, host, port):
|
||||
if host:
|
||||
s = start_client(host, port)
|
||||
self._client_socket = s
|
||||
else:
|
||||
s = start_server(port)
|
||||
|
||||
|
|
@ -2551,6 +2554,10 @@ class PyDB(object):
|
|||
except:
|
||||
pass
|
||||
finally:
|
||||
if self._client_socket:
|
||||
self._client_socket.close()
|
||||
self._client_socket = None
|
||||
|
||||
pydev_log.debug("PyDB.dispose_and_kill_all_pydevd_threads: finished")
|
||||
|
||||
def prepare_to_run(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue