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:
parent
1138a5cf99
commit
7e07d48cc5
@ -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)
|
||||
|
@ -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())
|
||||
|
||||
|
@ -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())
|
||||
|
||||
|
@ -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())
|
||||
|
3
tox.ini
3
tox.ini
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user