In progressbars.normalize, return DoNothing instead of None.

So caller doesn't need to do none checks as much.
master
voussoir 2022-11-07 17:54:55 -08:00
parent f522ffd54b
commit 405900cbf4
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ def do_nothing(*args, **kwargs):
def normalize(progressbar, total=None, *, topic=None) -> typing.Union[Progress, None]: def normalize(progressbar, total=None, *, topic=None) -> typing.Union[Progress, None]:
if progressbar is None: if progressbar is None:
return None return DoNothing()
elif isinstance(progressbar, Progress): elif isinstance(progressbar, Progress):
progressbar.set_total(total=total) progressbar.set_total(total=total)