Skip to content

Commit

Permalink
Avoid resolving symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed Jan 20, 2024
1 parent ee85553 commit 9ef1f79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bundled/tool/lsp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def _parse_output_using_regex(
if not data:
continue

filepath = utils.normalize_path(data["filepath"])
filepath = utils.absolute_path(data["filepath"])
type_ = data.get("type")
code = data.get("code")

Expand Down
5 changes: 5 additions & 0 deletions bundled/tool/lsp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ def normalize_path(file_path: str) -> str:
return str(pathlib.Path(file_path).resolve())


def absolute_path(file_path: str) -> str:
"""Returns absolute path without symlink resolve."""
return str(pathlib.Path(file_path).absolute())


def is_current_interpreter(executable) -> bool:
"""Returns true if the executable path is same as the current interpreter."""
return is_same_path(executable, sys.executable)
Expand Down

0 comments on commit 9ef1f79

Please sign in to comment.