Fix websockets and AttributeError: 'NoneType' object has no attribute
This commit is contained in:
parent
fea166abf2
commit
bb3fa955b2
1 changed files with 8 additions and 0 deletions
|
@ -162,6 +162,14 @@ class PlexWebSocketApp(websocket.WebSocketApp,
|
|||
if self.sleeptime < 6:
|
||||
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):
|
||||
"""
|
||||
Call this method from another thread to suspend this websocket thread
|
||||
|
|
Loading…
Reference in a new issue