Compare commits

..

2 Commits

Author SHA1 Message Date
f4db1ad95c fix prompt 2024-01-07 14:37:15 +00:00
efaee7594e should a socket operation be attempted after socket closed
then catch and log OSError and close thread.
2024-01-07 12:35:20 +00:00
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ def main():
) as client: ) as client:
client.callback.register([on_input_volume_meters, on_input_mute_state_changed]) client.callback.register([on_input_volume_meters, on_input_mute_state_changed])
while _ := input("<Enter> to exit>\n"): while _ := input("Press <Enter> to exit\n"):
pass pass

View File

@ -78,7 +78,7 @@ class EventClient:
except WebSocketTimeoutException as e: except WebSocketTimeoutException as e:
self.logger.exception(f"{type(e).__name__}: {e}") self.logger.exception(f"{type(e).__name__}: {e}")
raise OBSSDKTimeoutError("Timeout while waiting for event") from e raise OBSSDKTimeoutError("Timeout while waiting for event") from e
except WebSocketConnectionClosedException as e: except (WebSocketConnectionClosedException, OSError) as e:
self.logger.debug(f"{type(e).__name__} terminating the event thread") self.logger.debug(f"{type(e).__name__} terminating the event thread")
stop_event.set() stop_event.set()