mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-20 21:28:27 +08:00
Use the interpreter environment if the executable is not available, fixes #1531
This commit is contained in:
@@ -254,7 +254,14 @@ def get_cached_default_environment():
|
|||||||
|
|
||||||
@time_cache(seconds=10 * 60) # 10 Minutes
|
@time_cache(seconds=10 * 60) # 10 Minutes
|
||||||
def _get_cached_default_environment():
|
def _get_cached_default_environment():
|
||||||
return get_default_environment()
|
try:
|
||||||
|
return get_default_environment()
|
||||||
|
except InvalidPythonEnvironment:
|
||||||
|
# It's possible that `sys.executable` is wrong. Typically happens
|
||||||
|
# when Jedi is used in an executable that embeds Python. For further
|
||||||
|
# information, have a look at:
|
||||||
|
# https://github.com/davidhalter/jedi/issues/1531
|
||||||
|
return InterpreterEnvironment()
|
||||||
|
|
||||||
|
|
||||||
def find_virtualenvs(paths=None, **kwargs):
|
def find_virtualenvs(paths=None, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user