mirror of
https://github.com/platformio/platformio-core.git
synced 2025-08-01 19:04:29 +02:00
Fix removing temporary debugging data on Windows
This commit is contained in:
@@ -172,11 +172,12 @@ def debug_cmd(
|
|||||||
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
||||||
loop.run_until_complete(coro)
|
loop.run_until_complete(coro)
|
||||||
if IS_WINDOWS:
|
if IS_WINDOWS:
|
||||||
|
client.close()
|
||||||
# an issue with `asyncio` executor and STIDIN,
|
# an issue with `asyncio` executor and STIDIN,
|
||||||
# it cannot be closed gracefully
|
# it cannot be closed gracefully
|
||||||
proc.force_exit()
|
proc.force_exit()
|
||||||
finally:
|
finally:
|
||||||
del client
|
client.close()
|
||||||
loop.close()
|
loop.close()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@@ -66,6 +66,14 @@ class DebugClientProcess(DebugBaseProcess):
|
|||||||
self._server_process.terminate()
|
self._server_process.terminate()
|
||||||
super(DebugClientProcess, self).process_exited()
|
super(DebugClientProcess, self).process_exited()
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
self._unlock_session()
|
||||||
|
if self.working_dir and os.path.isdir(self.working_dir):
|
||||||
|
fs.rmtree(self.working_dir)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
self.close()
|
||||||
|
|
||||||
def _kill_previous_session(self):
|
def _kill_previous_session(self):
|
||||||
assert self._session_id
|
assert self._session_id
|
||||||
pid = None
|
pid = None
|
||||||
@@ -94,8 +102,3 @@ class DebugClientProcess(DebugBaseProcess):
|
|||||||
return
|
return
|
||||||
with ContentCache() as cc:
|
with ContentCache() as cc:
|
||||||
cc.delete(self._session_id)
|
cc.delete(self._session_id)
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
self._unlock_session()
|
|
||||||
if self.working_dir and os.path.isdir(self.working_dir):
|
|
||||||
fs.rmtree(self.working_dir)
|
|
||||||
|
Reference in New Issue
Block a user