Skip to content

Commit 83bdbf9

Browse files
committed
Reverse asyncio/trio check per review feedback
1 parent 76722f0 commit 83bdbf9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

elastic_transport/_async_transport.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,9 @@ async def perform_request( # type: ignore[override, return]
381381
)
382382

383383
async def sniff(self, is_initial_sniff: bool = False) -> None: # type: ignore[override]
384-
if sniffio.current_async_library() != "asyncio":
384+
if sniffio.current_async_library() == "trio":
385385
raise ValueError(
386-
f"Asynchronous sniffing only works with the 'asyncio' library, got {sniffio.current_async_library}"
386+
f"Asynchronous sniffing is not supported with the 'trio' library, got {sniffio.current_async_library}"
387387
)
388388
await self._async_call()
389389
task = self._create_sniffing_task(is_initial_sniff)
@@ -477,7 +477,7 @@ async def _async_call(self) -> None:
477477
return # Call at most once!
478478

479479
self._async_library = sniffio.current_async_library()
480-
if self._async_library != "asyncio":
480+
if self._async_library == "trio":
481481
return
482482

483483
self._loop = asyncio.get_running_loop()

0 commit comments

Comments
 (0)