Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Aug 31, 2023
1 parent d900f06 commit dbca4da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion supertokens_python/async_to_sync_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit dbca4da

Please sign in to comment.