Merge pull request #1505 from croneter/py3-fix-websockets

Fix websockets and AttributeError: 'NoneType' object has no attribute
This commit is contained in:
croneter 2021-05-29 17:12:41 +02:00 committed by GitHub
commit adead34f23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -162,6 +162,14 @@ class PlexWebSocketApp(websocket.WebSocketApp,
if self.sleeptime < 6: if self.sleeptime < 6:
self.sleeptime += 1 self.sleeptime += 1
def close(self, **kwargs):
"""websocket.WebSocketApp is not yet thread-safe. close() might
encounter websockets that have already been closed"""
try:
websocket.WebSocketApp.close(self, **kwargs)
except AttributeError:
pass
def suspend(self, block=False, timeout=None): def suspend(self, block=False, timeout=None):
""" """
Call this method from another thread to suspend this websocket thread Call this method from another thread to suspend this websocket thread