In progressbars.normalize, return DoNothing instead of None.

So caller doesn't need to do none checks as much.
This commit is contained in:
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

View file

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