Skip to content

Commit

Permalink
Import bundled packaging after path munging (#151)
Browse files Browse the repository at this point in the history
When using the bundled strategy and a vanilla system-wide interpreter (e.g., `/usr/bin/python3`) with `v2023.3.12551007`, `lsp_server.py` would die when attempting to import `packaging`. This is because the import was attempted before any `useBundled`-related path munging was made. This commit corrects for that.

Fixes #148.
  • Loading branch information
posita authored Sep 14, 2023
1 parent 1366475 commit a76586c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bundled/tool/lsp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
from dataclasses import dataclass
from typing import Any, Dict, List, Optional, Sequence

from packaging.version import Version
from packaging.version import parse as parse_version


# **********************************************************
# Update sys.path before importing any bundled libraries.
Expand Down Expand Up @@ -46,6 +43,8 @@ def update_sys_path(path_to_add: str, strategy: str) -> None:
# **********************************************************
import lsp_utils as utils
import lsprotocol.types as lsp
from packaging.version import Version
from packaging.version import parse as parse_version
from pygls import server, uris, workspace

WORKSPACE_SETTINGS = {}
Expand Down

0 comments on commit a76586c

Please sign in to comment.