From 684eac95832aa8ff15490a6fc4396ba61cf013ef Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 10 Aug 2015 20:26:19 -0700 Subject: [PATCH] Irc: fix the logic checking for data in run() --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 7d1af4b..2c6336f 100755 --- a/main.py +++ b/main.py @@ -130,8 +130,8 @@ class Irc(): log.debug('(%s) self.pingtimeout: %s', self.name, self.pingtimeout) data = self.socket.recv(2048) buf += data - if self.connected and not data: - log.warn('(%s) No data received and self.connected is not set; disconnecting!', self.name) + if self.connected.is_set() and not data: + log.warn('(%s) No data received and self.connected is set; disconnecting!', self.name) break while b'\n' in buf: line, buf = buf.split(b'\n', 1)