diff --git a/dandi/download.py b/dandi/download.py index 497fdaad7..ca94ae7db 100644 --- a/dandi/download.py +++ b/dandi/download.py @@ -803,14 +803,9 @@ def _download_file( attempts_allowed=attempts_allowed, downloaded_in_attempt=downloaded_in_attempt, ) - if not attempts_allowed: + if not isinstance(attempts_allowed_or_not, int) or not attempts_allowed: yield {"status": "error", "message": str(exc)} return - # for clear(er) typing, here we get only with int - assert isinstance(attempts_allowed_or_not, int), ( - f"attempts_allowed_or_not is {attempts_allowed_or_not!r} " - f"of type {type(attempts_allowed_or_not)}" - ) attempts_allowed = attempts_allowed_or_not else: lgr.warning("downloader logic: We should not be here!")