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.

Closes #178
This commit is contained in:
Arata Notsu 2015-06-01 16:32:38 +09:00 committed by Solly Ross
parent b445296816
commit f693871c58
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()[1]
self.msg("handler exception: %s", str(exc))
self.vmsg("exception", exc_info=True)