forked from VimPlug/jedi
This fixes two issues with the caching on Windows:
* the cache directory should really be %LOCALAPPDATA%
* ~ is not a meaningful directory on Windows. It should really be
os.path.expanduser('~'). To be honest it is probably always safe to
assume that os.getenv('LOCALAPPDATA') executes to something sensible
on any Windows system that hasn't been tampered with.
This commit is contained in:
committed by
Dave Halter
parent
bf4ec2282f
commit
1115cbd94d
@@ -69,8 +69,8 @@ Adds an opening bracket after a function for completions.
|
||||
# ----------------
|
||||
|
||||
if platform.system().lower() == 'windows':
|
||||
_cache_directory = os.path.join(os.getenv('APPDATA') or '~', 'Jedi',
|
||||
'Jedi')
|
||||
_cache_directory = os.path.join(os.getenv('LOCALAPPDATA') or
|
||||
os.path.expanduser('~'), 'Jedi', 'Jedi')
|
||||
elif platform.system().lower() == 'darwin':
|
||||
_cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi')
|
||||
else:
|
||||
@@ -81,7 +81,7 @@ cache_directory = os.path.expanduser(_cache_directory)
|
||||
The path where the cache is stored.
|
||||
|
||||
On Linux, this defaults to ``~/.cache/jedi/``, on OS X to
|
||||
``~/Library/Caches/Jedi/`` and on Windows to ``%APPDATA%\\Jedi\\Jedi\\``.
|
||||
``~/Library/Caches/Jedi/`` and on Windows to ``%LOCALAPPDATA%\\Jedi\\Jedi\\``.
|
||||
On Linux, if the environment variable ``$XDG_CACHE_HOME`` is set,
|
||||
``$XDG_CACHE_HOME/jedi`` is used instead of the default one.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user