From 996c739b2abdc1a8c70b2cf973e7cb68fbfa1a89 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 3 Jun 2016 23:30:31 -0700 Subject: [PATCH] oops, fix tests In some tests, we artificially call _event_connected() without first initiating a connection. --- src/wormhole/wormhole.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wormhole/wormhole.py b/src/wormhole/wormhole.py index 2ae41dd..14658cb 100644 --- a/src/wormhole/wormhole.py +++ b/src/wormhole/wormhole.py @@ -371,7 +371,8 @@ class _Wormhole: def _event_connected(self, ws): self._ws = ws - self._ws_t.finish() + if self._ws_t: + self._ws_t.finish() def _event_ws_opened(self, _): self._connection_state = OPEN