Fix n might be None when stopping workers

This commit is contained in:
Lonami Exo 2018-03-02 10:10:59 +01:00
parent f09ab6c6b6
commit 4c7224e56a

View File

@ -71,6 +71,7 @@ class UpdateState:
# Put dummy ``None`` objects so that they don't need to timeout.
n = self._workers
self._workers = None
if n:
with self._updates_lock:
for _ in range(n):
self._updates.put(None)