Skip to content

Commit

Permalink
Use asyncio.run
Browse files Browse the repository at this point in the history
  • Loading branch information
rrooggiieerr committed Jul 5, 2024
1 parent 34e27e8 commit a190866
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def async_test(coro):
def wrapper(*args, **kwargs):
loop = asyncio.new_event_loop()
try:
return loop.run_until_complete(coro(*args, **kwargs))
return asyncio.run(coro(*args, **kwargs))
finally:
loop.close()

Expand Down
2 changes: 1 addition & 1 deletion unii/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ async def main(unii):

try:
loop = asyncio.new_event_loop()
sys.exit(loop.run_until_complete(main(unii)))
sys.exit(asyncio.run(main(unii)))
finally:
loop.close()

0 comments on commit a190866

Please sign in to comment.