Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pip): improve error on python binary not being present #114

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions st3/lsp_utils/pip_client_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .server_resource_interface import ServerResourceInterface
from LSP.plugin.core.typing import List, Optional
from os import path
import shutil
import sublime

__all__ = ['PipClientHandler']
Expand Down Expand Up @@ -61,8 +62,11 @@ def manages_server(cls) -> bool:
@classmethod
def get_server(cls) -> Optional[ServerResourceInterface]:
if not cls.__server:
cls.__server = ServerPipResource(cls.storage_path(), cls.package_name, cls.requirements_txt_path,
cls.server_filename, cls.get_python_binary())
python_binary = cls.get_python_binary()
if not shutil.which(python_binary):
raise Exception('Python binary "{}" not found!'.format(python_binary))
cls.__server = ServerPipResource(
cls.storage_path(), cls.package_name, cls.requirements_txt_path, cls.server_filename, python_binary)
return cls.__server

@classmethod
Expand Down
Loading