Skip to content

Commit

Permalink
remove anyio from _utils.maybe_async
Browse files Browse the repository at this point in the history
  • Loading branch information
livioribeiro committed Oct 22, 2023
1 parent 760363f commit f004c1e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/selva/_util/maybe_async.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import asyncio
import functools
import inspect
from collections.abc import Awaitable, Callable
from typing import Any, ParamSpec

import anyio

P = ParamSpec("P")


Expand All @@ -22,4 +21,4 @@ async def maybe_async(
if inspect.iscoroutinefunction(call):
return await call(*args, **kwargs)

return await anyio.to_thread.run_sync(functools.partial(call, *args, **kwargs))
return await asyncio.to_thread(functools.partial(call, *args, **kwargs))

0 comments on commit f004c1e

Please sign in to comment.