|
@@ -1389,7 +1389,7 @@ class ThreadPool(object):
|
|
|
# Grow/shrink the pool if necessary.
|
|
# Grow/shrink the pool if necessary.
|
|
|
# Remove any dead threads from our list
|
|
# Remove any dead threads from our list
|
|
|
for t in self._threads:
|
|
for t in self._threads:
|
|
|
- if not t.isAlive():
|
|
|
|
|
|
|
+ if not t.is_alive():
|
|
|
self._threads.remove(t)
|
|
self._threads.remove(t)
|
|
|
amount -= 1
|
|
amount -= 1
|
|
|
|
|
|
|
@@ -1411,13 +1411,13 @@ class ThreadPool(object):
|
|
|
current = threading.currentThread()
|
|
current = threading.currentThread()
|
|
|
while self._threads:
|
|
while self._threads:
|
|
|
worker = self._threads.pop()
|
|
worker = self._threads.pop()
|
|
|
- if worker is not current and worker.isAlive():
|
|
|
|
|
|
|
+ if worker is not current and worker.is_alive():
|
|
|
try:
|
|
try:
|
|
|
if timeout is None or timeout < 0:
|
|
if timeout is None or timeout < 0:
|
|
|
worker.join()
|
|
worker.join()
|
|
|
else:
|
|
else:
|
|
|
worker.join(timeout)
|
|
worker.join(timeout)
|
|
|
- if worker.isAlive():
|
|
|
|
|
|
|
+ if worker.is_alive():
|
|
|
# We exhausted the timeout.
|
|
# We exhausted the timeout.
|
|
|
# Forcibly shut down the socket.
|
|
# Forcibly shut down the socket.
|
|
|
c = worker.conn
|
|
c = worker.conn
|