Avoid UnboundLocalError for exc

Previously exc was set only when an exception occurs in the inner
try (the one contains call to self.poll), so an error in the other
part causes an UnboundLocalError.
This commit is contained in:
Arata Notsu 2015-06-01 16:32:38 +09:00
parent 558a6439f1
commit 42bf1a30e3
1 changed files with 1 additions and 0 deletions

View File

@ -1047,6 +1047,7 @@ class WebSocketServer(object):
self.msg("In exit")
break
except Exception:
_, exc, _ = sys.exc_info()
self.msg("handler exception: %s", str(exc))
self.vmsg("exception", exc_info=True)