From 5dc2dd1ed2e02410ecf2f03bb3c7dca3382aad2f Mon Sep 17 00:00:00 2001 From: Drini Cami Date: Thu, 2 Nov 2023 15:34:23 -0400 Subject: [PATCH] Fix mypy error --- openlibrary/catalog/get_ia.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlibrary/catalog/get_ia.py b/openlibrary/catalog/get_ia.py index 1aa87e32e63..e325abf81c0 100644 --- a/openlibrary/catalog/get_ia.py +++ b/openlibrary/catalog/get_ia.py @@ -22,7 +22,7 @@ def urlopen_keep_trying(url: str, headers=None, **kwargs): resp.raise_for_status() return resp except requests.HTTPError as error: - if error.response.status_code in (403, 404, 416): + if error.response and error.response.status_code in (403, 404, 416): raise sleep(2)