File: 0001_port_to_python3.14.patch

package info (click to toggle)
python-openleadr-python 0.5.34%2Bdfsg.1-3
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,548 kB
  • sloc: python: 6,946; xml: 663; makefile: 32; sh: 18
file content (24 lines) | stat: -rw-r--r-- 888 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Port to python 3.14
 In Python 3.14, get_event_loop() no longer create a new event loop
 when there is none. Thus we modify the code to create a new event loop
 if there is RuntimeError.
Author: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Bug-Debian: https://bugs.debian.org/1123277
Last-Update: 2025-12-25
Index: python-openleadr-python-0.5.34+dfsg.1/test/test_reports.py
===================================================================
--- python-openleadr-python-0.5.34+dfsg.1.orig/test/test_reports.py
+++ python-openleadr-python-0.5.34+dfsg.1/test/test_reports.py
@@ -10,7 +10,11 @@ import time
 
 from openleadr.messaging import create_message
 
-loop = asyncio.get_event_loop()
+try:
+    loop = asyncio.get_event_loop()
+except RuntimeError:
+    loop = asyncio.new_event_loop()
+    asyncio.set_event_loop(loop)
 loop.set_debug(True)
 
 enable_default_logging()