Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
tito committed Mar 24, 2017
1 parent 26f098f commit 5f96eab
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ws4py/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def __init__(self, poller=None):
provide your own ``poller``.
"""
threading.Thread.__init__(self)
self.name="WebSocketManager"
self.name = "WebSocketManager"
self.lock = threading.Lock()
self.websockets = {}
self.running = False
Expand Down Expand Up @@ -315,12 +315,13 @@ def run(self):

ws = self.websockets.get(fd)
if ws and not ws.terminated:
#I don't know what kind of errors might spew out of here, but they probably shouldn't crash the entire server.
# I don't know what kind of errors might spew out of here
# but they probably shouldn't crash the entire server.
try:
x = ws.once()
#Treat the error as if once() had returned None
# Treat the error as if once() had returned None
except Exception as e:
x=None
x = None
logger.error("Terminating websocket %s due to exception: %s in once method" % (format_addresses(ws), repr(e)) )
if not x:
with self.lock:
Expand Down

0 comments on commit 5f96eab

Please sign in to comment.