aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/lsp
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-01-20 20:46:51 +0100
committerTristan Gingold <tgingold@free.fr>2021-01-20 20:48:24 +0100
commit4f484625f9587d2f12a6e2f8ed9cac2fff467183 (patch)
treed81fc5536c18881622bd0d05581fd2adb272e159 /pyGHDL/lsp
parent91782b27a9df8f7f615dbb8263a65c5caa18cf84 (diff)
downloadghdl-4f484625f9587d2f12a6e2f8ed9cac2fff467183.tar.gz
ghdl-4f484625f9587d2f12a6e2f8ed9cac2fff467183.tar.bz2
ghdl-4f484625f9587d2f12a6e2f8ed9cac2fff467183.zip
lsp.py: only use urllib (as python3 is required)
Diffstat (limited to 'pyGHDL/lsp')
-rw-r--r--pyGHDL/lsp/lsp.py9
1 files changed, 3 insertions, 6 deletions
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