From 3caf1b762a8a784d27290b3b52a89ab3c20b6049 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 16 Jan 2021 16:07:53 +0100 Subject: pyGHDL: tentatively fix tests failure --- pyGHDL/lsp/lsp.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'pyGHDL/lsp') diff --git a/pyGHDL/lsp/lsp.py b/pyGHDL/lsp/lsp.py index eaa0cdfac..caaef6b2e 100644 --- a/pyGHDL/lsp/lsp.py +++ b/pyGHDL/lsp/lsp.py @@ -36,11 +36,13 @@ class LSPConn: def path_from_uri(uri): # Convert file uri to path (strip html like head part) if not uri.startswith("file://"): + # No scheme return uri - if os.name == "nt": - _, path = uri.split("file:///", 1) - else: - _, path = uri.split("file://", 1) + _, path = uri.split("file://", 1) + if os.name == "nt" and path.startswith("/"): + # On windows, absolute files start like "/C:/aa/bbb". + # Remove the first "/". + path = path[1:] return os.path.normpath(unquote(path)) -- cgit v1.2.3