Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

refactor(h2-stream): alphabetical order of imports

Adityae3233b79deee
diff --git a/scrapy/core/downloader/handlers/http2.py b/scrapy/core/downloader/handlers/http2.py
index f2ed40f9b..ddd813cec 100644
--- a/scrapy/core/downloader/handlers/http2.py
+++ b/scrapy/core/downloader/handlers/http2.py
@@ -29,7 +29,7 @@ class H2DownloadHandler:
def from_crawler(cls, crawler):
return cls(crawler.settings, crawler)
- def download_request(self, request: Request, spider: Spider):
+ def download_request(self, request: Request, spider: Spider) -> Deferred:
agent = ScrapyH2Agent(
context_factory=self._context_factory,
pool=self._pool,
diff --git a/scrapy/core/http2/stream.py b/scrapy/core/http2/stream.py
index bddf50a56..33302421e 100644
--- a/scrapy/core/http2/stream.py
+++ b/scrapy/core/http2/stream.py
@@ -5,7 +5,7 @@ from typing import List, Optional, Tuple, TYPE_CHECKING
from urllib.parse import urlparse
from h2.errors import ErrorCodes
-from h2.exceptions import H2Error, StreamClosedError, ProtocolError
+from h2.exceptions import H2Error, ProtocolError, StreamClosedError
from hpack import HeaderTuple
from twisted.internet.defer import Deferred, CancelledError
from twisted.internet.error import ConnectionClosed