From 0c70fc178d42c19825794804101ee6370842c4b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=B2=D0=B5=D0=BB=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=9D=D0=B8=D0=BA?= =?UTF-8?q?=D0=BE=D0=BB=D0=B0=D0=B5=D0=B2=D0=B8=D1=87?= Date: Mon, 25 Mar 2024 14:31:00 +0300 Subject: [PATCH] Add fallback for 'ujson' import --- pylsp/python_lsp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pylsp/python_lsp.py b/pylsp/python_lsp.py index c606a7c6..528ffdb4 100644 --- a/pylsp/python_lsp.py +++ b/pylsp/python_lsp.py @@ -9,7 +9,11 @@ from functools import partial from typing import Any, Dict, List -import ujson as json +try: + import ujson as json +except Exception: + import json + from pylsp_jsonrpc.dispatchers import MethodDispatcher from pylsp_jsonrpc.endpoint import Endpoint from pylsp_jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWriter