Merge pull request #753 from datastax/python-749

remove uses of map that don't work in py3
This commit is contained in:
Jim Witschey 2017-05-09 08:20:51 -07:00 committed by GitHub
commit 941dab462b
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: for conn in self._live_conns | self._new_conns | self._closed_conns:
conn.close() 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 self.notify() # wake the timer watcher
log.debug("Waiting for event loop thread to join...") log.debug("Waiting for event loop thread to join...")

View File

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