Scrapy, a fast high-level web crawling & scraping framework for Python.
PEP8 adjustments for scrapy.http.response module
Eugenio Lacuesta6f4e84ecf95f
diff --git a/scrapy/http/response/__init__.py b/scrapy/http/response/__init__.pyindex 79a8d0ca0..b9e638551 100644--- a/scrapy/http/response/__init__.py+++ b/scrapy/http/response/__init__.py@@ -4,6 +4,8 @@ responses in Scrapy.See documentation in docs/topics/request-response.rst"""+from typing import Generator+from six.moves.urllib.parse import urljoinfrom scrapy.http.request import Request@@ -41,8 +43,8 @@ class Response(object_ref):if isinstance(url, str):self._url = urlelse:- raise TypeError('%s url must be str, got %s:' % (type(self).__name__,- type(url).__name__))+ raise TypeError('%s url must be str, got %s:' %+ (type(self).__name__, type(url).__name__))url = property(_get_url, obsolete_setter(_set_url, 'url'))diff --git a/scrapy/http/response/html.py b/scrapy/http/response/html.pyindex bd3559fbb..7eed052c2 100644--- a/scrapy/http/response/html.py+++ b/scrapy/http/response/html.py@@ -7,5 +7,6 @@ See documentation in docs/topics/request-response.rstfrom scrapy.http.response.text import TextResponse+class HtmlResponse(TextResponse):passdiff --git a/scrapy/http/response/text.py b/scrapy/http/response/text.pyindex b97420345..6acf1026f 100644--- a/scrapy/http/response/text.py+++ b/scrapy/http/response/text.py@@ -6,6 +6,7 @@ See documentation in docs/topics/request-response.rst"""from contextlib import suppress+from typing import Generatorimport parselimport six@@ -14,6 +15,7 @@ from w3lib.encoding import (html_body_declared_encoding, html_to_unicode,http_content_type_encoding, resolve_encoding)from w3lib.html import strip_html5_whitespace+from scrapy.http import Requestfrom scrapy.http.response import Responsefrom scrapy.utils.python import memoizemethod_noargs, to_unicodefrom scrapy.utils.response import get_base_urldiff --git a/scrapy/http/response/xml.py b/scrapy/http/response/xml.pyindex 1df33fee5..abf474a2f 100644--- a/scrapy/http/response/xml.py+++ b/scrapy/http/response/xml.py@@ -7,5 +7,6 @@ See documentation in docs/topics/request-response.rstfrom scrapy.http.response.text import TextResponse+class XmlResponse(TextResponse):pass