Skip to content

Commit 5a053c7

Browse files
committed
Drop ujson and switch to orjson
1 parent dd31328 commit 5a053c7

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

pylsp/__main__.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
# Copyright 2021- Python Language Server Contributors.
33

44
import argparse
5+
import json
56
import logging
67
import logging.config
78
import sys
89
import time
910

10-
try:
11-
import ujson as json
12-
except Exception:
13-
import json
14-
1511
from ._version import __version__
1612
from .python_lsp import (
1713
PythonLSPServer,

pylsp/plugins/pylint_lint.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
from pylsp import hookimpl, lsp
1616

1717
try:
18-
import ujson as json
19-
except Exception:
18+
import orjson as json
19+
except ImportError:
2020
import json
2121

2222
log = logging.getLogger(__name__)

pylsp/python_lsp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from typing import Any, Dict, List
1111

1212
try:
13-
import ujson as json
14-
except Exception:
13+
import orjson as json
14+
except ImportError:
1515
import json
1616

1717
from pylsp_jsonrpc.dispatchers import MethodDispatcher

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
"jedi>=0.17.2,<0.20.0",
1919
"pluggy>=1.0.0",
2020
"python-lsp-jsonrpc>=1.1.0,<2.0.0",
21-
"ujson>=3.0.0",
21+
"orjson>=3.10.0",
2222
]
2323
dynamic = ["version"]
2424

0 commit comments

Comments
 (0)