From 9fa8902f1a908984d3cedc422a5be634fa09d43f Mon Sep 17 00:00:00 2001 From: nemunaire Date: Sat, 12 Sep 2015 14:35:40 +0200 Subject: [PATCH] Invalid fd are < 0, not only -1 --- nemubot/bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nemubot/bot.py b/nemubot/bot.py index d83f22e..d5510a7 100644 --- a/nemubot/bot.py +++ b/nemubot/bot.py @@ -138,17 +138,17 @@ class Bot(threading.Thread): fnd_smth = False # Looking for invalid server for r in _rlist: - if not hasattr(r, "fileno") or not isinstance(r.fileno(), int) or r.fileno() == -1: + if not hasattr(r, "fileno") or not isinstance(r.fileno(), int) or r.fileno() < 0: _rlist.remove(r) logger.error("Found invalid object in _rlist: " + r) fnd_smth = True for w in _wlist: - if not hasattr(w, "fileno") or not isinstance(w.fileno(), int) or w.fileno() == -1: + if not hasattr(w, "fileno") or not isinstance(w.fileno(), int) or w.fileno() < 0: _wlist.remove(w) logger.error("Found invalid object in _wlist: " + w) fnd_smth = True for x in _xlist: - if not hasattr(x, "fileno") or not isinstance(x.fileno(), int) or x.fileno() == -1: + if not hasattr(x, "fileno") or not isinstance(x.fileno(), int) or x.fileno() < 0: _xlist.remove(x) logger.error("Found invalid object in _xlist: " + x) fnd_smth = True