Skip to content

Commit e16e37e

Browse files
committed
Fix starting the server for Python 3.14
1 parent ab1b069 commit e16e37e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pylsp/python_lsp.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55
import os
66
import socketserver
7+
import sys
78
import threading
89
import uuid
910
from functools import partial
@@ -71,9 +72,13 @@ def shutdown_server(check_parent_process, *args):
7172
handler_class.__name__ + "Handler",
7273
(_StreamHandlerWrapper,),
7374
{
74-
"DELEGATE_CLASS": partial(
75-
handler_class, check_parent_process=check_parent_process
76-
),
75+
# We need to wrap this in staticmethod due to the changes to
76+
# functools.partial in Python 3.14+
77+
"DELEGATE_CLASS": staticmethod(
78+
partial(handler_class, check_parent_process=check_parent_process)
79+
)
80+
if sys.version_info >= (3, 14)
81+
else partial(handler_class, check_parent_process=check_parent_process),
7782
"SHUTDOWN_CALL": partial(shutdown_server, check_parent_process),
7883
},
7984
)

0 commit comments

Comments
 (0)