diff --git a/supertokens_python/async_to_sync_wrapper.py b/supertokens_python/async_to_sync_wrapper.py index 0e9286ee7..9c623bf51 100644 --- a/supertokens_python/async_to_sync_wrapper.py +++ b/supertokens_python/async_to_sync_wrapper.py @@ -25,11 +25,11 @@ def check_event_loop(): except RuntimeError as ex: if "There is no current event loop in thread" in str(ex): loop = asyncio.new_event_loop() + nest_asyncio.apply(loop) # type: ignore asyncio.set_event_loop(loop) def sync(co: Coroutine[Any, Any, _T]) -> _T: check_event_loop() loop = asyncio.get_event_loop() - nest_asyncio.apply(loop) # type: ignore return loop.run_until_complete(co)