Skip to content

Commit a73e9b8

Browse files
committed
Delay reactor import
1 parent 8d40248 commit a73e9b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scrapy_playwright/_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from scrapy.http.headers import Headers
1010
from scrapy.settings import Settings
1111
from scrapy.utils.python import to_unicode
12-
from twisted.internet import reactor
1312
from twisted.internet.defer import Deferred
1413
from twisted.python import failure
1514
from w3lib.encoding import html_body_declared_encoding, http_content_type_encoding
@@ -118,6 +117,8 @@ class _ThreadedLoopAdapter:
118117

119118
@classmethod
120119
async def _handle_coro(cls, coro: Awaitable, dfd: Deferred) -> None:
120+
from twisted.internet import reactor
121+
121122
try:
122123
result = await coro
123124
except Exception as exc:

0 commit comments

Comments
 (0)