From 0b41b359a70bbbf3a648862a9b849d60b9ff6c3b Mon Sep 17 00:00:00 2001 From: Chris Patterson Date: Fri, 11 Feb 2022 23:40:45 -0500 Subject: sources/azure: address mypy/pyright typing complaints (#1245) Raise runtime errors for unhandled cases which would cause other exceptions. Ignore types for a few cases where a non-trivial refactor would be required to prevent the warning. Signed-off-by: Chris Patterson --- cloudinit/url_helper.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cloudinit/url_helper.py') diff --git a/cloudinit/url_helper.py b/cloudinit/url_helper.py index 790e2fbf..5b2f2ef9 100644 --- a/cloudinit/url_helper.py +++ b/cloudinit/url_helper.py @@ -188,7 +188,7 @@ def readurl( infinite=False, log_req_resp=True, request_method=None, -): +) -> UrlResponse: """Wrapper around requests.Session to read the url and retry if necessary :param url: Mandatory url to request. @@ -339,9 +339,8 @@ def readurl( sec_between, ) time.sleep(sec_between) - if excps: - raise excps[-1] - return None # Should throw before this... + + raise excps[-1] def wait_for_url( -- cgit v1.2.3