File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -531,11 +531,12 @@ def _get_xdg_config_dir():
531
531
base directory spec
532
532
<http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_.
533
533
"""
534
- home = get_home ()
535
- if home is None :
536
- return None
537
- else :
538
- return os .environ .get ('XDG_CONFIG_HOME' , os .path .join (home , '.config' ))
534
+ path = os .environ .get ('XDG_CONFIG_HOME' )
535
+ if path is None :
536
+ path = get_home ()
537
+ if path is not None :
538
+ path = os .path .join (path , '.config' )
539
+ return path
539
540
540
541
541
542
def _get_xdg_cache_dir ():
@@ -544,11 +545,12 @@ def _get_xdg_cache_dir():
544
545
base directory spec
545
546
<http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_.
546
547
"""
547
- home = get_home ()
548
- if home is None :
549
- return None
550
- else :
551
- return os .environ .get ('XDG_CACHE_HOME' , os .path .join (home , '.cache' ))
548
+ path = os .environ .get ('XDG_CACHE_HOME' )
549
+ if path is None :
550
+ path = get_home ()
551
+ if path is not None :
552
+ path = os .path .join (path , '.cache' )
553
+ return path
552
554
553
555
554
556
def _get_config_or_cache_dir (xdg_base ):
@@ -568,9 +570,8 @@ def _get_config_or_cache_dir(xdg_base):
568
570
h = get_home ()
569
571
if h is not None :
570
572
p = os .path .join (h , '.matplotlib' )
571
- if (sys .platform .startswith ('linux' ) and
572
- xdg_base is not None ):
573
- p = os .path .join (xdg_base , 'matplotlib' )
573
+ if (sys .platform .startswith ('linux' ) and xdg_base ):
574
+ p = os .path .join (xdg_base , 'matplotlib' )
574
575
575
576
if p is not None :
576
577
if os .path .exists (p ):
You can’t perform that action at this time.
0 commit comments