Skip to content

Commit e8de439

Browse files
authored
Merge pull request #21 from graingert/patch-1
swap asyncio/curio checks
2 parents 4a33d64 + 920a29a commit e8de439

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Diff for: sniffio/_impl.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ async def generic_sleep(seconds):
5656
if value is not None:
5757
return value
5858

59-
# Sniff for curio (for now)
60-
if 'curio' in sys.modules:
61-
from curio.meta import curio_running
62-
if curio_running():
63-
return 'curio'
64-
6559
# Need to sniff for asyncio
6660
if "asyncio" in sys.modules:
6761
import asyncio
@@ -78,6 +72,13 @@ async def generic_sleep(seconds):
7872
return "asyncio"
7973
except RuntimeError:
8074
pass
75+
76+
# Sniff for curio (for now)
77+
if 'curio' in sys.modules:
78+
from curio.meta import curio_running
79+
if curio_running():
80+
return 'curio'
81+
8182
raise AsyncLibraryNotFoundError(
8283
"unknown async library, or not in async context"
8384
)

0 commit comments

Comments
 (0)