Skip to content

Commit 9f9a03f

Browse files
authored
Fix tqdm callback garbage collection (#1463)
1 parent 1438e88 commit 9f9a03f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fsspec/callbacks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ def relative_update(self, inc=1):
231231
self.tqdm.update(inc)
232232

233233
def __del__(self):
234-
self.tqdm.close()
234+
if hasattr(self.tqdm, "close"):
235+
self.tqdm.close()
235236
self.tqdm = None
236237

237238

0 commit comments

Comments
 (0)