Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 412ca06

Browse files
committed
Fix bug in XFG_CONFIG handling
1 parent 5883040 commit 412ca06

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,15 +547,16 @@ def _get_config_or_cache_dir(xdg_base):
547547
p = os.path.join(h, '.matplotlib')
548548
if (sys.platform.startswith('linux') and
549549
not os.path.exists(p)):
550-
p = _get_xdg_config_dir()
550+
p = os.path.join(xdg_base, 'matplotlib')
551551

552552
if os.path.exists(p):
553553
if not _is_writable_dir(p):
554554
return _create_tmp_config_dir()
555555
else:
556-
if not _is_writable_dir(h):
556+
try:
557+
mkdirs(p)
558+
except OSError:
557559
return _create_tmp_config_dir()
558-
mkdirs(p)
559560

560561
return p
561562

0 commit comments

Comments
 (0)