From 912cfa69b6f675b0141448cf88c231c940a3a66d Mon Sep 17 00:00:00 2001 From: Joe Harrison Date: Sun, 8 Mar 2020 20:24:32 +0000 Subject: [PATCH] maintain python2.7 regex library compatibility --- src/wormhole_transit_relay/transit_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wormhole_transit_relay/transit_server.py b/src/wormhole_transit_relay/transit_server.py index 0d1383d..5e4e646 100644 --- a/src/wormhole_transit_relay/transit_server.py +++ b/src/wormhole_transit_relay/transit_server.py @@ -56,13 +56,13 @@ class TransitConnection(LineReceiver): def lineReceived(self, line): # old: "please relay {64}\n" - old = re.fullmatch(br"please relay (\w{64})", line) + old = re.search(br"^please relay (\w{64})$", line) if old: token = old.group(1) return self._got_handshake(token, None) # new: "please relay {64} for side {16}\n" - new = re.fullmatch(br"please relay (\w{64}) for side (\w{16})", line) + new = re.search(br"^please relay (\w{64}) for side (\w{16})$", line) if new: token = new.group(1) side = new.group(2)