gui: Fix a bug which dfu cmd can cause connrst err

- Kirdy may close and reset itself before host computer ends its session
This commit is contained in:
linuswck 2024-06-17 12:46:42 +08:00
parent da50f372d9
commit 92f6b83b16
1 changed files with 5 additions and 1 deletions

View File

@ -646,7 +646,11 @@ class Kirdy:
# Reader needn't be closed # Reader needn't be closed
self._writer.close() self._writer.close()
await self._writer.wait_closed() try:
await self._writer.wait_closed()
except ConnectionResetError:
# In Hard Reset/DFU cmd, Kirdy may close its socket first
pass
self._reader = None self._reader = None
self._writer = None self._writer = None