Skip to content

Commit 68905a4

Browse files
committed
Python 3.14 raises RuntimeError if there are no running loops
Recommended approach is to simply use asyncio.run(fn) https://docs.python.org/3/whatsnew/3.14.html#id10 Fixes: #314
1 parent 50b06ae commit 68905a4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tcadmin/main.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ def run_pre_check(name):
4242
def run_async(fn):
4343
@functools.wraps(fn)
4444
def wrap(*args, **kwargs):
45-
try:
46-
loop = asyncio.get_event_loop()
47-
return loop.run_until_complete(fn(*args, **kwargs))
48-
finally:
49-
loop.close()
45+
asyncio.run(fn(*args, **kwargs))
5046

5147
return wrap
5248

0 commit comments

Comments
 (0)