commit:     18d8abb063d7730fbb86d451489dc2acf36c1327
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 15 22:25:03 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 15 22:31:07 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=18d8abb0

EventLoop: fix AttributeError in add/remove_reader

Fixes: 24f861173ebe ("EventLoop: implement add/remove_reader/writer for asyncio 
compat (bug 649588)")

 pym/portage/util/_eventloop/EventLoop.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/util/_eventloop/EventLoop.py 
b/pym/portage/util/_eventloop/EventLoop.py
index a928f3138..32dc2fc9d 100644
--- a/pym/portage/util/_eventloop/EventLoop.py
+++ b/pym/portage/util/_eventloop/EventLoop.py
@@ -609,7 +609,7 @@ class EventLoop(object):
                Stop watching the file descriptor for read availability.
                """
                handler = self._poll_event_handlers.get(fd)
-               if fd is not None:
+               if handler is not None:
                        return self.source_remove(handler.source_id)
                return False
 
@@ -627,7 +627,7 @@ class EventLoop(object):
                Stop watching the file descriptor for write availability.
                """
                handler = self._poll_event_handlers.get(fd)
-               if fd is not None:
+               if handler is not None:
                        return self.source_remove(handler.source_id)
                return False
 

Reply via email to