Skip to content

Commit 75c8d67

Browse files
jairhenriquexrmx
andauthored
Uses iscoroutinefunction from inspect module (open-telemetry#4786)
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
1 parent e10e7ac commit 75c8d67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opentelemetry-api/src/opentelemetry/util/_decorator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import asyncio
1615
import contextlib
1716
import functools
17+
import inspect
1818
from typing import TYPE_CHECKING, Callable, Generic, Iterator, TypeVar
1919

2020
V = TypeVar("V")
@@ -63,7 +63,7 @@ def __enter__(self) -> R:
6363
raise RuntimeError("generator didn't yield") from None
6464

6565
def __call__(self, func: V) -> V: # pyright: ignore [reportIncompatibleMethodOverride]
66-
if asyncio.iscoroutinefunction(func):
66+
if inspect.iscoroutinefunction(func):
6767

6868
@functools.wraps(func) # type: ignore
6969
async def async_wrapper(*args: Pargs, **kwargs: Pkwargs) -> R: # pyright: ignore [reportInvalidTypeVarUse]

0 commit comments

Comments
 (0)