remove uses of map that don't work in py3

This commit is contained in:
Jim Witschey 2017-05-04 09:37:18 -07:00
parent 9adf704800
commit d014f88349
2 changed files with 7 additions and 3 deletions

View File

@ -121,7 +121,9 @@ class LibevLoop(object):
for conn in self._live_conns | self._new_conns | self._closed_conns:
conn.close()
map(lambda w: w.stop(), (w for w in (conn._write_watcher, conn._read_watcher) if w))
for watcher in (conn._write_watcher, conn._read_watcher):
if watcher:
watcher.stop()
self.notify() # wake the timer watcher
log.debug("Waiting for event loop thread to join...")

View File

@ -108,8 +108,10 @@ class RoundRobinPolicyTest(unittest.TestCase):
self.assertEqual(sorted(qplan), hosts)
threads = [Thread(target=check_query_plan) for i in range(4)]
map(lambda t: t.start(), threads)
map(lambda t: t.join(), threads)
for t in threads:
t.start()
for t in threads:
t.join()
def test_thread_safety_during_modification(self):
hosts = range(100)