From 95cda869287fa6a7bf1405d0acdb62df1a7286b0 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Wed, 8 Jun 2016 21:22:14 +0100 Subject: [PATCH] irc: do not busy wait when EOS from IRC --- tipbot/modules/irc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tipbot/modules/irc.py b/tipbot/modules/irc.py index 4a45655..183862f 100644 --- a/tipbot/modules/irc.py +++ b/tipbot/modules/irc.py @@ -443,6 +443,8 @@ class IRCNetwork(Network): (r,w,x)=select.select([self.irc.fileno()],[],[],1) if self.irc.fileno() in r: newdata=self._irc_recv(4096,socket.MSG_DONTWAIT) + if len(newdata) == 0: + raise RuntimeError('0 bytes received, EOF') else: newdata = None if self.irc.fileno() in x: