Skip to content

Commit 622d808

Browse files
committed
fix: error in Python 3.14
1 parent 9d7c84f commit 622d808

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

blurry/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ def runserver():
177177

178178
SETTINGS["RUNSERVER"] = True
179179

180-
event_loop = asyncio.get_event_loop()
180+
event_loop = asyncio.new_event_loop()
181+
asyncio.set_event_loop(event_loop)
181182
event_loop.create_task(build(release=False))
182183

183184
jinja_env = get_jinja_env()

blurry/async_typer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ def decorator(async_func):
1010
# Convert async function to synchronous
1111
@wraps(async_func)
1212
def sync_func(*_args, **_kwargs):
13-
loop = asyncio.get_event_loop()
13+
loop = asyncio.new_event_loop()
14+
asyncio.set_event_loop(loop)
1415
return loop.run_until_complete(async_func(*_args, **_kwargs))
1516

1617
# Register synchronous function

0 commit comments

Comments
 (0)