1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-06 10:24:24 +00:00

Small 3.7 and 3.8 cleanup.

This commit is contained in:
Andrey Rakhmatullin 2024-10-17 23:22:37 +05:00
parent 1138a5cf99
commit 7e07d48cc5
5 changed files with 5 additions and 10 deletions

View File

@ -97,10 +97,8 @@ def get_asyncio_event_loop_policy() -> AbstractEventLoopPolicy:
def _get_asyncio_event_loop_policy() -> AbstractEventLoopPolicy:
policy = asyncio.get_event_loop_policy()
if (
sys.version_info >= (3, 8)
and sys.platform == "win32"
and not isinstance(policy, asyncio.WindowsSelectorEventLoopPolicy)
if sys.platform == "win32" and not isinstance(
policy, asyncio.WindowsSelectorEventLoopPolicy
):
policy = asyncio.WindowsSelectorEventLoopPolicy()
asyncio.set_event_loop_policy(policy)

View File

@ -3,7 +3,7 @@ import sys
from twisted.internet import asyncioreactor
if sys.version_info >= (3, 8) and sys.platform == "win32":
if sys.platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncioreactor.install(asyncio.get_event_loop())

View File

@ -4,7 +4,7 @@ import sys
from twisted.internet import asyncioreactor
from twisted.python import log
if sys.version_info >= (3, 8) and sys.platform == "win32":
if sys.platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncioreactor.install(asyncio.get_event_loop())

View File

@ -4,7 +4,7 @@ import sys
from twisted.internet import asyncioreactor
from uvloop import Loop
if sys.version_info >= (3, 8) and sys.platform == "win32":
if sys.platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.set_event_loop(Loop())
asyncioreactor.install(asyncio.get_event_loop())

View File

@ -26,9 +26,6 @@ deps =
# mitmproxy does not support PyPy
mitmproxy; implementation_name != 'pypy'
# https://github.com/pallets/werkzeug/pull/2768 breaks flask, required by
# mitmproxy.
werkzeug < 3; python_version < '3.9' and implementation_name != 'pypy'
passenv =
S3_TEST_FILE_URI
AWS_ACCESS_KEY_ID