From 622d808cb2adfc9d64efe4451752c6907dc52b98 Mon Sep 17 00:00:00 2001 From: John Franey <1728528+johnfraney@users.noreply.github.com> Date: Wed, 8 Apr 2026 18:43:24 -0300 Subject: [PATCH] fix: error in Python 3.14 --- blurry/__init__.py | 3 ++- blurry/async_typer.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blurry/__init__.py b/blurry/__init__.py index 916288d..9f424eb 100644 --- a/blurry/__init__.py +++ b/blurry/__init__.py @@ -177,7 +177,8 @@ def runserver(): SETTINGS["RUNSERVER"] = True - event_loop = asyncio.get_event_loop() + event_loop = asyncio.new_event_loop() + asyncio.set_event_loop(event_loop) event_loop.create_task(build(release=False)) jinja_env = get_jinja_env() diff --git a/blurry/async_typer.py b/blurry/async_typer.py index b3f2497..120cc92 100644 --- a/blurry/async_typer.py +++ b/blurry/async_typer.py @@ -10,7 +10,8 @@ def decorator(async_func): # Convert async function to synchronous @wraps(async_func) def sync_func(*_args, **_kwargs): - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) return loop.run_until_complete(async_func(*_args, **_kwargs)) # Register synchronous function