mirror of https://github.com/tqdm/tqdm.git
fix the WeakSet keyError bug
This commit is contained in:
parent
6d33b1178d
commit
d19d6476a3
|
@ -478,7 +478,9 @@ class tqdm(Comparable):
|
|||
"""
|
||||
with cls._lock:
|
||||
try:
|
||||
cls._instances.remove(instance)
|
||||
if instance in cls._instances:
|
||||
# in python2 instance maybe magically removed from cls._instances
|
||||
cls._instances.remove(instance)
|
||||
except KeyError:
|
||||
if not instance.gui: # pragma: no cover
|
||||
raise
|
||||
|
|
Loading…
Reference in New Issue