Skip to content

Commit

Permalink
TqdmCallback: minor fixup, check for None explicitly
Browse files Browse the repository at this point in the history
Tqdm supports __bool__, so we should really use `is not None` test
rather than boolean check. This is not used anywhere right now, but
I'd prefer being correct.
  • Loading branch information
skshetry committed May 10, 2022
1 parent 8fb2f65 commit f10dbef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dvc/fs/_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def progress_bar(self):
from dvc.progress import Tqdm

return self._stack.enter_context(
self._progress_bar or Tqdm(**self._tqdm_kwargs)
self._progress_bar
if self._progress_bar is not None
else Tqdm(**self._tqdm_kwargs)
)

def __enter__(self):
Expand Down

0 comments on commit f10dbef

Please sign in to comment.