From 876dea82972c16dd82c039c5420c2552305edc09 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 23 Apr 2017 16:31:26 -0400 Subject: [PATCH] transit: ignore new data in "hung up" state Apparently there's an intermittent condition in tests that follows this path. We used to ignore unrecognized states, but to improve test coverage I added a clause to catch them, and now that clause is happening where I didn't expect it. --- src/wormhole/transit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wormhole/transit.py b/src/wormhole/transit.py index 5088895..addb3cb 100644 --- a/src/wormhole/transit.py +++ b/src/wormhole/transit.py @@ -243,6 +243,8 @@ class Connection(protocol.Protocol, policies.TimeoutMixin): raise BadHandshake("abandoned") if self.state == "records": return self.dataReceivedRECORDS() + if self.state == "hung up": + pass if isinstance(self.state, Exception): # for tests raise self.state raise ValueError("internal error: unknown state %s" % (self.state,))