Skip to content

Commit e0585e5

Browse files
change asyncio to inspect for iscoroutinefunction
1 parent 6ce096b commit e0585e5

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

sentry_sdk/integrations/fastapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import asyncio
1+
import inspect
22
from copy import deepcopy
33
from functools import wraps
44

@@ -73,7 +73,7 @@ def _sentry_get_request_handler(*args: "Any", **kwargs: "Any") -> "Any":
7373
if (
7474
dependant
7575
and dependant.call is not None
76-
and not asyncio.iscoroutinefunction(dependant.call)
76+
and not inspect.iscoroutinefunction(dependant.call)
7777
):
7878
old_call = dependant.call
7979

sentry_sdk/integrations/starlette.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import asyncio
1+
import inspect
22
import functools
33
import warnings
44
from collections.abc import Set
@@ -424,8 +424,8 @@ def _is_async_callable(obj: "Any") -> bool:
424424
while isinstance(obj, functools.partial):
425425
obj = obj.func
426426

427-
return asyncio.iscoroutinefunction(obj) or (
428-
callable(obj) and asyncio.iscoroutinefunction(obj.__call__)
427+
return inspect.iscoroutinefunction(obj) or (
428+
callable(obj) and inspect.iscoroutinefunction(obj.__call__)
429429
)
430430

431431

0 commit comments

Comments
 (0)