Use sys.implementation.name instead of platform.python_implementation()
This commit is contained in:
@@ -44,4 +44,4 @@ repos:
|
||||
- types-aiofiles
|
||||
- typing-extensions<5; python_version < "3.11"
|
||||
- tomli<3; python_version < "3.11"
|
||||
- uvloop<0.20; platform_python_implementation == "CPython" and (sys_platform == "darwin" or sys_platform == "linux")
|
||||
- uvloop<0.20; implementation_name == "cpython" and (sys_platform == "darwin" or sys_platform == "linux")
|
||||
|
||||
Generated
+1
-1
@@ -1282,4 +1282,4 @@ termux = []
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.8"
|
||||
content-hash = "4e9ed735edd49c4e3fd13e3b61aab06e290edbf29069994f399277e675a0ca07"
|
||||
content-hash = "f15afce60a11a55270abf068ea841832d01bdeb6b64ed0b480d6cbe95e2f7c06"
|
||||
|
||||
@@ -2,7 +2,6 @@ from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
import platform
|
||||
import sys
|
||||
from typing import TYPE_CHECKING, Dict, Mapping
|
||||
|
||||
@@ -37,7 +36,7 @@ logger = logging.getLogger(__name__)
|
||||
def set_event_loop_policy() -> None:
|
||||
if sys.platform == "win32":
|
||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
elif platform.python_implementation() == "CPython" and sys.platform in {
|
||||
elif sys.implementation.name == "cpython" and sys.platform in {
|
||||
"darwin",
|
||||
"linux",
|
||||
}:
|
||||
|
||||
+3
-3
@@ -14,8 +14,8 @@ aiofiles = ">=0.8"
|
||||
aiohttp = "^3.8.6"
|
||||
aiohttp-socks = ">=0.7,<0.9"
|
||||
attrs = ">=22.2"
|
||||
brotli = { version = "^1", markers = "platform_python_implementation == 'CPython'" }
|
||||
brotlicffi = { version = "<2", markers = "platform_python_implementation != 'CPython'" }
|
||||
brotli = { version = "^1", markers = "implementation_name == 'cpython'" }
|
||||
brotlicffi = { version = "<2", markers = "implementation_name != 'cpython'" }
|
||||
certifi = "*"
|
||||
charset-normalizer = ">=2,<4"
|
||||
maxminddb = ">=1.3,<3"
|
||||
@@ -23,7 +23,7 @@ platformdirs = "<5"
|
||||
rich = ">=12.3,<14"
|
||||
tomli = { version = "<3", python = "<3.11" }
|
||||
typing-extensions = { version = "^4.4", python = "<3.11" }
|
||||
uvloop = { version = ">=0.14,<0.20", optional = true, markers = "platform_python_implementation == 'CPython' and (sys_platform == 'darwin' or sys_platform == 'linux')" }
|
||||
uvloop = { version = ">=0.14,<0.20", optional = true, markers = "implementation_name == 'cpython' and (sys_platform == 'darwin' or sys_platform == 'linux')" }
|
||||
|
||||
[tool.poetry.extras]
|
||||
non-termux = ["aiodns", "uvloop"]
|
||||
|
||||
Reference in New Issue
Block a user