Skip to content

Commit 97f73df

Browse files
committed
lispy-python.py: Print a warning if we can't load jedi
This may happen when trying to load on a remote system that has nothing installed.
1 parent 2289815 commit 97f73df

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lispy-python.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ def sh(cmd: str) -> str:
5454
try:
5555
import jedi
5656
except:
57-
pyenv_version = sh("pyenv global")
58-
pyversion = ".".join(pyenv_version.split(".")[:-1])
59-
site_packages = os.path.expanduser(f"~/.pyenv/versions/{pyenv_version}/lib/python{pyversion}/site-packages/")
60-
sys.path.append(site_packages)
61-
import jedi
57+
try:
58+
pyenv_version = sh("pyenv global")
59+
pyversion = ".".join(pyenv_version.split(".")[:-1])
60+
site_packages = os.path.expanduser(f"~/.pyenv/versions/{pyenv_version}/lib/python{pyversion}/site-packages/")
61+
sys.path.append(site_packages)
62+
import jedi
63+
except:
64+
print("Failed to load jedi. Some features won't work")
6265

6366
#* Classes
6467
class Stack:

0 commit comments

Comments
 (0)