1
0
forked from VimPlug/jedi

If the VIRTUAL_ENV variable changes, need to reload the default environment, fixes #1201, #1200

This commit is contained in:
Dave Halter
2018-09-30 19:06:40 +02:00
parent f9cbc65f2d
commit 862f611829
3 changed files with 18 additions and 2 deletions

View File

@@ -189,8 +189,16 @@ def get_default_environment():
return SameEnvironment()
@time_cache(seconds=10 * 60) # 10 Minutes
def get_cached_default_environment():
environment = _get_cached_default_environment()
if environment.path != os.environ.get('VIRTUAL_ENV'):
_get_cached_default_environment.clear_cache()
return _get_cached_default_environment()
return environment
@time_cache(seconds=10 * 60) # 10 Minutes
def _get_cached_default_environment():
return get_default_environment()