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
@@ -57,6 +57,7 @@ Code Contributors
|
|||||||
- Tim Gates (@timgates42) <tim.gates@iress.com>
|
- Tim Gates (@timgates42) <tim.gates@iress.com>
|
||||||
- Lior Goldberg (@goldberglior)
|
- Lior Goldberg (@goldberglior)
|
||||||
- Ryan Clary (@mrclary)
|
- Ryan Clary (@mrclary)
|
||||||
|
- Max Mäusezahl (@mmaeusezahl) <maxmaeusezahl@googlemail.com>
|
||||||
|
|
||||||
And a few more "anonymous" contributors.
|
And a few more "anonymous" contributors.
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -69,8 +69,8 @@ Adds an opening bracket after a function for completions.
|
|||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
_cache_directory = os.path.join(os.getenv('APPDATA') or '~', 'Jedi',
|
_cache_directory = os.path.join(os.getenv('LOCALAPPDATA') or
|
||||||
'Jedi')
|
os.path.expanduser('~'), 'Jedi', 'Jedi')
|
||||||
elif platform.system().lower() == 'darwin':
|
elif platform.system().lower() == 'darwin':
|
||||||
_cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi')
|
_cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi')
|
||||||
else:
|
else:
|
||||||
@@ -81,7 +81,7 @@ cache_directory = os.path.expanduser(_cache_directory)
|
|||||||
The path where the cache is stored.
|
The path where the cache is stored.
|
||||||
|
|
||||||
On Linux, this defaults to ``~/.cache/jedi/``, on OS X to
|
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,
|
On Linux, if the environment variable ``$XDG_CACHE_HOME`` is set,
|
||||||
``$XDG_CACHE_HOME/jedi`` is used instead of the default one.
|
``$XDG_CACHE_HOME/jedi`` is used instead of the default one.
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user