Skip to content

Commit d0e2291

Browse files
authored
Enforce asyncio reactor in all platforms (#298)
1 parent 848955e commit d0e2291

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,14 @@ requests will be processed by the regular Scrapy download handler.
7676

7777
### Twisted reactor
7878

79-
When running on GNU/Linux or macOS you'll need to
80-
[install the `asyncio`-based Twisted reactor](https://docs.scrapy.org/en/latest/topics/asyncio.html#installing-the-asyncio-reactor):
79+
[Install the `asyncio`-based Twisted reactor](https://docs.scrapy.org/en/latest/topics/asyncio.html#installing-the-asyncio-reactor):
8180

8281
```python
8382
# settings.py
8483
TWISTED_REACTOR = "twisted.internet.asyncioreactor.AsyncioSelectorReactor"
8584
```
8685

87-
This is not a requirement on Windows (see [Windows support](#windows-support))
86+
This is the default in new projects since [Scrapy 2.7](https://github.com/scrapy/scrapy/releases/tag/2.7.0).
8887

8988

9089
## Basic usage

scrapy_playwright/handler.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import asyncio
22
import logging
3-
import platform
43
from contextlib import suppress
54
from dataclasses import dataclass, field as dataclass_field
65
from ipaddress import ip_address
@@ -132,8 +131,7 @@ class ScrapyPlaywrightDownloadHandler(HTTPDownloadHandler):
132131
def __init__(self, crawler: Crawler) -> None:
133132
super().__init__(settings=crawler.settings, crawler=crawler)
134133
_ThreadedLoopAdapter.start()
135-
if platform.system() != "Windows":
136-
verify_installed_reactor("twisted.internet.asyncioreactor.AsyncioSelectorReactor")
134+
verify_installed_reactor("twisted.internet.asyncioreactor.AsyncioSelectorReactor")
137135
crawler.signals.connect(self._engine_started, signals.engine_started)
138136
self.stats = crawler.stats
139137

0 commit comments

Comments
 (0)