Show More
@@ -15,13 +15,11 b' import glob' | |||
|
15 | 15 | from warnings import warn |
|
16 | 16 | |
|
17 | 17 | from IPython.utils.process import system |
|
18 | from IPython.utils import py3compat | |
|
19 | 18 | from IPython.utils.decorators import undoc |
|
20 | 19 | |
|
21 | 20 | #----------------------------------------------------------------------------- |
|
22 | 21 | # Code |
|
23 | 22 | #----------------------------------------------------------------------------- |
|
24 | ||
|
25 | 23 | fs_encoding = sys.getfilesystemencoding() |
|
26 | 24 | |
|
27 | 25 | def _writable_dir(path): |
@@ -226,7 +224,8 b' def get_xdg_dir():' | |||
|
226 | 224 | # use ~/.config if empty OR not set |
|
227 | 225 | xdg = env.get("XDG_CONFIG_HOME", None) or os.path.join(get_home_dir(), '.config') |
|
228 | 226 | if xdg and _writable_dir(xdg): |
|
229 | return py3compat.cast_unicode(xdg, fs_encoding) | |
|
227 | assert isinstance(xdg, str) | |
|
228 | return xdg | |
|
230 | 229 | |
|
231 | 230 | return None |
|
232 | 231 | |
@@ -244,7 +243,8 b' def get_xdg_cache_dir():' | |||
|
244 | 243 | # use ~/.cache if empty OR not set |
|
245 | 244 | xdg = env.get("XDG_CACHE_HOME", None) or os.path.join(get_home_dir(), '.cache') |
|
246 | 245 | if xdg and _writable_dir(xdg): |
|
247 | return py3compat.cast_unicode(xdg, fs_encoding) | |
|
246 | assert isinstance(xdg, str) | |
|
247 | return xdg | |
|
248 | 248 | |
|
249 | 249 | return None |
|
250 | 250 |
General Comments 0
You need to be logged in to leave comments.
Login now