mypy: Add backoff-stubs.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-08-09 16:37:15 -07:00
committed by Tim Abbott
parent 09564e95ac
commit 05124737f7
6 changed files with 14 additions and 3 deletions

View File

@@ -272,7 +272,12 @@ def send_email(
raise EmailNotDeliveredException
@backoff.on_exception(backoff.expo, OSError, max_tries=MAX_CONNECTION_TRIES, logger=None)
@backoff.on_exception(
backoff.expo,
OSError,
max_tries=MAX_CONNECTION_TRIES,
logger=None, # type: ignore[arg-type] # https://github.com/gleb-chipiga/backoff-stubs/pull/2
)
def initialize_connection(connection: Optional[BaseEmailBackend] = None) -> BaseEmailBackend:
if not connection:
connection = get_connection()