diff --git a/pkgs/development/python-modules/sqlalchemy/1.3-0001-fix-create-new-event-loop-if-not-exists.patch b/pkgs/development/python-modules/sqlalchemy/1.3-0001-fix-create-new-event-loop-if-not-exists.patch new file mode 100644 index 000000000000..e10c13868423 --- /dev/null +++ b/pkgs/development/python-modules/sqlalchemy/1.3-0001-fix-create-new-event-loop-if-not-exists.patch @@ -0,0 +1,26 @@ +From 98fd6e87243c6d5992429a9b90426af73dbcc3ff Mon Sep 17 00:00:00 2001 +From: Bart Oostveen +Date: Fri, 10 Jul 2026 13:59:21 +0200 +Subject: [PATCH] fix: create new event loop if not exists + +--- + lib/sqlalchemy/util/_concurrency_py3k.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/lib/sqlalchemy/util/_concurrency_py3k.py b/lib/sqlalchemy/util/_concurrency_py3k.py +index 1e4ffef..5aaf12c 100644 +--- a/lib/sqlalchemy/util/_concurrency_py3k.py ++++ b/lib/sqlalchemy/util/_concurrency_py3k.py +@@ -190,6 +190,8 @@ def get_event_loop(): + try: + return asyncio.get_running_loop() + except RuntimeError: +- return asyncio.get_event_loop_policy().get_event_loop() ++ loop = asyncio.new_event_loop() ++ asyncio.set_event_loop(loop) ++ return loop + else: + return asyncio.get_event_loop() +-- +2.54.0 + diff --git a/pkgs/development/python-modules/sqlalchemy/1_3.nix b/pkgs/development/python-modules/sqlalchemy/1_3.nix index b57cd123a030..38670bc2b31c 100644 --- a/pkgs/development/python-modules/sqlalchemy/1_3.nix +++ b/pkgs/development/python-modules/sqlalchemy/1_3.nix @@ -37,6 +37,8 @@ buildPythonPackage (finalAttrs: { hash = "sha256-6qAjyqMVrugABHssAQuql3z1YHTAOSm5hARJuJXJJvo="; }; + patches = [ ./1.3-0001-fix-create-new-event-loop-if-not-exists.patch ]; + postPatch = '' sed -i '/tag_build = dev/d' setup.cfg '';