Skip to content

Commit 7d57649

Browse files
committed
Handle AttributeError when stream interface is None
Added a specific exception handler for AttributeError in the streaming loop to gracefully handle cases where the stream interface is already disconnected.
1 parent 44988e1 commit 7d57649

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/explorepy/parser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ def _stream_loop(self):
204204
except EOFError:
205205
logger.info('End of file')
206206
self.stop_streaming()
207+
except AttributeError:
208+
if self.stream_interface is None:
209+
# device already disconnected
210+
pass
207211
except Exception as error:
208212
logger.critical('Unexpected error: ', error)
209213
self.stop_streaming()

0 commit comments

Comments
 (0)