From 789dfc96c532e373a8f8af056f80b3ae5e8060f3 Mon Sep 17 00:00:00 2001 From: dpedu Date: Fri, 19 Jun 2015 21:52:05 -0700 Subject: [PATCH] Use private map for asynchat --- pyircbot/irccore.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyircbot/irccore.py b/pyircbot/irccore.py index c00aef2..600ee6a 100644 --- a/pyircbot/irccore.py +++ b/pyircbot/irccore.py @@ -45,9 +45,12 @@ class IRCCore(asynchat.async_chat): # Set up hooks for modules self.initHooks() + + # Map for asynchat + self.asynmap = {} def loop(self): - asyncore.loop() + asyncore.loop(map=self.asynmap) def kill(self): """TODO close the socket""" @@ -106,6 +109,7 @@ class IRCCore(asynchat.async_chat): self.create_socket(socket_type, socket.SOCK_STREAM) self.connect(socketInfo[0][4]) + self.asynmap[self._fileno] = self def handle_connect(self): """When asynchat indicates our socket is connected, fire the connect hook"""