aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2024-10-28 13:37:52 -0700
committerZac Medico <zmedico@gentoo.org>2024-10-28 15:02:34 -0700
commitea889ce3eef083ff1e2658d0e70e7bed38015332 (patch)
tree819ed38addd7eb284196fd9d6414f2edd9e74957
parentHandle python3.14 ChildWatcher changes (diff)
downloadportage-ea889ce3eef083ff1e2658d0e70e7bed38015332.tar.gz
portage-ea889ce3eef083ff1e2658d0e70e7bed38015332.tar.bz2
portage-ea889ce3eef083ff1e2658d0e70e7bed38015332.zip
Alway import iscoroutinefunction from inspect
This is available in all supported python versions. Fixes: 7218c9cea618 ("Fix asyncio.iscoroutinefunction DeprecationWarning in Python 3.14.0a1") Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/portage/process.py6
-rw-r--r--lib/portage/util/futures/_asyncio/__init__.py6
2 files changed, 2 insertions, 10 deletions
diff --git a/lib/portage/process.py b/lib/portage/process.py
index a66b6a541..3f2c48e92 100644
--- a/lib/portage/process.py
+++ b/lib/portage/process.py
@@ -22,11 +22,7 @@ import warnings
from dataclasses import dataclass
from functools import lru_cache, partial
from typing import Any, Optional, Callable, Union
-
-try:
- from inspect import iscoroutinefunction
-except ImportError:
- iscoroutinefunction = _asyncio.iscoroutinefunction
+from inspect import iscoroutinefunction
from portage import os
from portage import _encodings
diff --git a/lib/portage/util/futures/_asyncio/__init__.py b/lib/portage/util/futures/_asyncio/__init__.py
index ea67adcae..9f248bf90 100644
--- a/lib/portage/util/futures/_asyncio/__init__.py
+++ b/lib/portage/util/futures/_asyncio/__init__.py
@@ -44,11 +44,7 @@ from asyncio import (
wait_for,
)
-try:
- from inspect import iscoroutinefunction
-except ImportError:
- iscoroutinefunction = _asyncio.iscoroutinefunction
-
+from inspect import iscoroutinefunction
import threading
from typing import Optional