From 3c8d3a38bd398bcd1038b0fabab5923c1954f4ad Mon Sep 17 00:00:00 2001 From: mattsaxon Date: Tue, 30 Apr 2019 08:38:46 +0100 Subject: [PATCH] Fix Py3.5 compile issue --- pysonofflan/client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pysonofflan/client.py b/pysonofflan/client.py index 9dd08fa..92b48f4 100644 --- a/pysonofflan/client.py +++ b/pysonofflan/client.py @@ -125,8 +125,8 @@ def __init__(self, **kwds): self.ping_interval = V6_DEFAULT_PING_INTERVAL self.ping_timeout = V6_DEFAULT_TIMEOUT - self.close_code: int - self.close_reason: str + #self.close_code: int + #self.close_reason: str # Task sending keepalive pings. self.keepalive_ping_task = None @@ -260,10 +260,10 @@ def connection_lost(self, exc): logger.debug("%s - event = connection_lost(%s)", self.side, exc) self.state = State.CLOSED logger.debug("%s - state = CLOSED", self.side) - #if not hasattr(self, "close_code"): - self.close_code = 1006 - #if not hasattr(self, "close_reason"): - self.close_reason = "" + if self.close_code is None: + self.close_code = 1006 + if self.close_reason is None: + self.close_reason = "" logger.debug( "%s x code = %d, reason = %s", self.side,