Skip to content

Commit 436a710

Browse files
committed
Fix construction of local decorator on older Python
`kw_only` and `match_args` are new in Python 3.10.
1 parent 1d12b8c commit 436a710

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jedi_language_server/initialization_options.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66

77
import re
8+
import sys
89
from dataclasses import dataclass, field, fields, is_dataclass
910
from typing import Any, List, Optional, Pattern, Set
1011

@@ -15,7 +16,11 @@
1516
# pylint: disable=missing-class-docstring
1617
# pylint: disable=too-few-public-methods
1718

18-
light_dataclass = dataclass(kw_only=True, eq=False, match_args=False)
19+
if sys.version_info >= (3, 10):
20+
# pylint: disable-next=unexpected-keyword-arg
21+
light_dataclass = dataclass(kw_only=True, eq=False, match_args=False)
22+
else:
23+
light_dataclass = dataclass(eq=False)
1924

2025

2126
@light_dataclass

0 commit comments

Comments
 (0)