In progressbars.normalize, return DoNothing instead of None.
So caller doesn't need to do none checks as much.master
parent
f522ffd54b
commit
405900cbf4
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue