Skip to content

Commit

Permalink
fix: RuntimeWarning: coroutine 'Client.close_async' was never awaited (
Browse files Browse the repository at this point in the history
  • Loading branch information
Ro0tk1t authored Nov 18, 2022
1 parent 966cff1 commit d0ff6bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ def make_sync(future):
# Generate an event loop if there isn't any.
event_loop = asyncio.new_event_loop()
asyncio.set_event_loop(event_loop)
return event_loop.run_until_complete(future)
if event_loop.is_running():
return event_loop.create_task(future)
else:
return event_loop.run_until_complete(future)

0 comments on commit d0ff6bd

Please sign in to comment.