diff --git a/cassandra/io/libevreactor.py b/cassandra/io/libevreactor.py index 9b19d1f3..39f871a1 100644 --- a/cassandra/io/libevreactor.py +++ b/cassandra/io/libevreactor.py @@ -121,10 +121,7 @@ class LibevLoop(object): for conn in self._live_conns | self._new_conns | self._closed_conns: conn.close() - if conn._write_watcher: - conn._write_watcher.stop() - if conn._read_watcher: - conn._read_watcher.stop() + map(lambda w: w.stop(), (w for w in (conn._write_watcher, conn._read_watcher) if w)) self.notify() # wake the timer watcher log.debug("Waiting for event loop thread to join...")