def poll(self, timeout=<NUM_LIT:0.0>):
if self.sock_map is None:<EOL><INDENT>Log.warning("<STR_LIT>")<EOL><DEDENT>readable_lst = []<EOL>writable_lst = []<EOL>error_lst = []<EOL>if self.sock_map is not None:<EOL><INDENT>for fd, obj in self.sock_map.items():<EOL><INDENT>is_r = obj.readable()<EOL>is_w = obj.writable()<EOL>if is_r:<EOL><INDENT>readable_lst.append(fd)<EOL><DEDENT>if is_w and not obj.accepting:<EOL><INDENT>writable_lst.append(fd)<EOL><DEDENT>if is_r or is_w:<EOL><INDENT>error_lst.append(fd)<EOL><DEDENT><DEDENT><DEDENT>readable_lst.append(self.pipe_r)<EOL>Log.debug("<STR_LIT>" + str(timeout) + "<STR_LIT>" + str(self.sock_map))<EOL>try:<EOL><INDENT>readable_lst, writable_lst, error_lst =select.select(readable_lst, writable_lst, error_lst, timeout)<EOL><DEDENT>except select.error as err:<EOL><INDENT>Log.debug("<STR_LIT>" + str(err))<EOL>if err.args[<NUM_LIT:0>] != errno.EINTR:<EOL><INDENT>raise<EOL><DEDENT>else:<EOL><INDENT>return<EOL><DEDENT><DEDENT>Log.debug("<STR_LIT>" + str(readable_lst) +<EOL>"<STR_LIT>" + str(writable_lst) + "<STR_LIT>" + str(error_lst))<EOL>if self.pipe_r in readable_lst:<EOL><INDENT>Log.debug("<STR_LIT>")<EOL>os.read(self.pipe_r, <NUM_LIT>)<EOL>readable_lst.remove(self.pipe_r)<EOL><DEDENT>if self.sock_map is not None:<EOL><INDENT>for fd in readable_lst:<EOL><INDENT>obj = self.sock_map.get(fd)<EOL>if obj is None:<EOL><INDENT>continue<EOL><DEDENT>asyncore.read(obj)<EOL><DEDENT>for fd in writable_lst:<EOL><INDENT>obj = self.sock_map.get(fd)<EOL>if obj is None:<EOL><INDENT>continue<EOL><DEDENT>asyncore.write(obj)<EOL><DEDENT>for fd in error_lst:<EOL><INDENT>obj = self.sock_map.get(fd)<EOL>if obj is None:<EOL><INDENT>continue<EOL><DEDENT>asyncore._exception(obj)<EOL><DEDENT><DEDENT>
Modified version of poll() from asyncore module