mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-17 18:46:40 +00:00
Fix n might be None when stopping workers
This commit is contained in:
parent
f09ab6c6b6
commit
4c7224e56a
@ -71,9 +71,10 @@ class UpdateState:
|
|||||||
# Put dummy ``None`` objects so that they don't need to timeout.
|
# Put dummy ``None`` objects so that they don't need to timeout.
|
||||||
n = self._workers
|
n = self._workers
|
||||||
self._workers = None
|
self._workers = None
|
||||||
with self._updates_lock:
|
if n:
|
||||||
for _ in range(n):
|
with self._updates_lock:
|
||||||
self._updates.put(None)
|
for _ in range(n):
|
||||||
|
self._updates.put(None)
|
||||||
|
|
||||||
for t in self._worker_threads:
|
for t in self._worker_threads:
|
||||||
t.join()
|
t.join()
|
||||||
|
Loading…
Reference in New Issue
Block a user