GeezerVison is showing github.com — Drop ujson and switch to orjson · python-lsp/python-lsp-server@5a053c7
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: pylsp/__main__.py +1-5Lines changed: 1 addition & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
2 | 2 | # Copyright 2021- Python Language Server Contributors. |
3 | 3 |
|
4 | 4 | import argparse |
| 5 | +import json |
5 | 6 | import logging |
6 | 7 | import logging.config |
7 | 8 | import sys |
8 | 9 | import time |
9 | 10 |
|
10 | | -try: |
11 | | - import ujson as json |
12 | | -except Exception: |
13 | | - import json |
14 | | - |
15 | 11 | from ._version import __version__ |
16 | 12 | from .python_lsp import ( |
17 | 13 | PythonLSPServer, |
|
Collapse file
Copy file name to clipboardExpand all lines: pylsp/plugins/pylint_lint.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
15 | 15 | from pylsp import hookimpl, lsp |
16 | 16 |
|
17 | 17 | try: |
18 | | - import ujson as json |
19 | | -except Exception: |
| 18 | + import orjson as json |
| 19 | +except ImportError: |
20 | 20 | import json |
21 | 21 |
|
22 | 22 | log = logging.getLogger(__name__) |
|
Collapse file
Copy file name to clipboardExpand all lines: pylsp/python_lsp.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
10 | 10 | from typing import Any, Dict, List |
11 | 11 |
|
12 | 12 | try: |
13 | | - import ujson as json |
14 | | -except Exception: |
| 13 | + import orjson as json |
| 14 | +except ImportError: |
15 | 15 | import json |
16 | 16 |
|
17 | 17 | from pylsp_jsonrpc.dispatchers import MethodDispatcher |
|
Collapse file
Copy file name to clipboardExpand all lines: pyproject.toml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,7 @@ dependencies = [ |
18 | 18 | "jedi>=0.17.2,<0.20.0", |
19 | 19 | "pluggy>=1.0.0", |
20 | 20 | "python-lsp-jsonrpc>=1.1.0,<2.0.0", |
21 | | - "ujson>=3.0.0", |
| 21 | + "orjson>=3.10.0", |
22 | 22 | ] |
23 | 23 | dynamic = ["version"] |
24 | 24 |
|
|