diff options
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r-- | Lib/asyncore.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 7fb84b4..7bd269b 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -201,6 +201,11 @@ class dispatcher: addr = None def __init__(self, sock=None, map=None): + if map is None: + self._map = socket_map + else: + self._map = map + if sock: self.set_socket(sock, map) # I think it should inherit this anyway @@ -232,13 +237,13 @@ class dispatcher: def add_channel(self, map=None): #self.log_info('adding channel %s' % self) if map is None: - map = socket_map + map = self._map map[self._fileno] = self def del_channel(self, map=None): fd = self._fileno if map is None: - map = socket_map + map = self._map if map.has_key(fd): #self.log_info('closing channel %d:%s' % (fd, self)) del map[fd] |