We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cfdab8 commit 07c2df7Copy full SHA for 07c2df7
sniffio/_impl.py
@@ -74,6 +74,12 @@ async def generic_sleep(seconds):
74
# Need to sniff for asyncio
75
if "asyncio" in sys.modules:
76
import asyncio
77
+ try:
78
+ asyncio.get_running_loop()
79
+ return "asyncio"
80
+ except (AttributeError, RuntimeError):
81
+ pass
82
+
83
try:
84
current_task = asyncio.current_task # type: ignore[attr-defined]
85
except AttributeError:
0 commit comments