Skip to content

Commit aff9334

Browse files
committed
Use uvloop/winloop.run as recommended
When uvloop/winloop upgraded to v0.19.0/v0.1.0 respectively, they introduced run, the new recommended way to run a coro w/ uvloop/winloop.
1 parent 5fa7fb8 commit aff9334

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bot/launcher.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import asyncio
21
import os
32

43
import asyncpg
54
import discord
65
from aiohttp import ClientSession
76
from environs import Env
87
from libs.utils import RodhajLogger
8+
99
from rodhaj import Rodhaj
1010

1111
if os.name == "nt":
12-
from winloop import install
12+
from winloop import run
1313
else:
14-
from uvloop import install
14+
from uvloop import run
1515

1616
# Hope not to trip pyright
1717
env = Env()
@@ -37,8 +37,7 @@ async def main() -> None:
3737

3838
def launch() -> None:
3939
with RodhajLogger():
40-
install()
41-
asyncio.run(main())
40+
run(main())
4241

4342

4443
if __name__ == "__main__":

0 commit comments

Comments
 (0)