Skip to content

Commit

Permalink
Alway import iscoroutinefunction from inspect
Browse files Browse the repository at this point in the history
This is available in all supported python versions.

Fixes: 7218c9c ("Fix asyncio.iscoroutinefunction DeprecationWarning in Python 3.14.0a1")
Signed-off-by: Zac Medico <zmedico@gentoo.org>
  • Loading branch information
zmedico committed Oct 28, 2024
1 parent 69c8459 commit ea889ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions lib/portage/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
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
Expand Down
6 changes: 1 addition & 5 deletions lib/portage/util/futures/_asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@
wait_for,
)

try:
from inspect import iscoroutinefunction
except ImportError:
iscoroutinefunction = _asyncio.iscoroutinefunction

from inspect import iscoroutinefunction
import threading
from typing import Optional

Expand Down

0 comments on commit ea889ce

Please sign in to comment.