From b543e31cd2a665b25aab4554e46a0ed5067d1bfe Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 30 Oct 2018 17:49:35 +0000 Subject: Fix/refactor issues brought up by type hint linting --- src/utils/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/utils/http.py') diff --git a/src/utils/http.py b/src/utils/http.py index b949e9ff..8856cd43 100644 --- a/src/utils/http.py +++ b/src/utils/http.py @@ -8,7 +8,7 @@ REGEX_HTTP = re.compile("https?://", re.I) RESPONSE_MAX = (1024*1024)*100 -class HTTPException: +class HTTPException(Exception): pass class HTTPTimeoutException(HTTPException): pass @@ -52,7 +52,7 @@ def get_url(url: str, method: str="GET", get_params: dict={}, if soup: soup = bs4.BeautifulSoup(response_content, parser) if code: - return response.code, soup + return response.status_code, soup return soup data = response_content.decode(response.encoding or fallback_encoding) -- cgit v1.3.1-10-gc9f91