Skip to content

Commit d7fe624

Browse files
committed
fix(langserver): support for Python 3.14
fixes #512 Signed-off-by: Daniel Biehl <dbiehl@live.de>
1 parent b7af857 commit d7fe624

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

hatch.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ post-install-commands = ["pip install -U -e {root:uri}/../robotframework"]
6464
python = "3.10"
6565

6666
[[envs.devel.matrix]]
67-
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
67+
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
6868
rf = ["rf50", "rf60", "rf61", "rf70", "rf71", "rf72", "rf73"]
6969

7070
[envs.devel.overrides]

packages/core/src/robotcode/core/async_tools.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ async def create_inner_task(coro: Callable[..., Coroutine[Any, Any, _T]], *args:
7979

8080
ct = asyncio.current_task()
8181

82-
loop = asyncio.get_event_loop()
83-
loop.slow_callback_duration = 10
82+
try:
83+
loop = asyncio.get_event_loop()
84+
loop.slow_callback_duration = 10
85+
except RuntimeError:
86+
pass
8487

8588
callback_added_event.wait(600)
8689

packages/jsonrpc2/src/robotcode/jsonrpc2/server.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ def __init__(
7272
self._in_closing = False
7373
self._closed = False
7474

75-
self.loop = asyncio.get_event_loop()
75+
try:
76+
self.loop = asyncio.get_event_loop()
77+
except RuntimeError:
78+
self.loop = asyncio.new_event_loop()
79+
asyncio.set_event_loop(self.loop)
80+
7681
if self.loop is not None:
7782
self.loop.slow_callback_duration = 10
7883

0 commit comments

Comments
 (0)