From 4f484625f9587d2f12a6e2f8ed9cac2fff467183 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 20 Jan 2021 20:46:51 +0100 Subject: lsp.py: only use urllib (as python3 is required) --- pyGHDL/lsp/lsp.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'pyGHDL/lsp') diff --git a/pyGHDL/lsp/lsp.py b/pyGHDL/lsp/lsp.py index 79ab39ce8..1806db8d8 100644 --- a/pyGHDL/lsp/lsp.py +++ b/pyGHDL/lsp/lsp.py @@ -1,12 +1,7 @@ import os import logging import json - -try: - from urllib.parse import unquote, quote -except ImportError: - from urllib2 import quote - from urlparse import unquote +from urllib.parse import unquote, quote log = logging.getLogger("ghdl-ls") @@ -36,6 +31,8 @@ class LSPConn: def path_from_uri(uri): # Convert file uri to path (strip html like head part) + # This is needed to get the root path and to load a document when the + # textual source is not present. if not uri.startswith("file://"): # No scheme return uri -- cgit v1.2.3