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

Skip to content

Commit 6d8c067

Browse files
committed
Fix loading of XDG config file
1 parent a898464 commit 6d8c067

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
@@ -569,7 +569,6 @@ def _get_config_or_cache_dir(xdg_base):
569569
if h is not None:
570570
p = os.path.join(h, '.matplotlib')
571571
if (sys.platform.startswith('linux') and
572-
not os.path.exists(p) and
573572
xdg_base is not None):
574573
p = os.path.join(xdg_base, 'matplotlib')
575574

@@ -744,8 +743,8 @@ def matplotlib_fname():
744743
home = get_home()
745744
if (sys.platform.startswith('linux') and
746745
home is not None and
747-
fname == os.path.join(
748-
home, '.matplotlib', 'matplotlibrc')):
746+
os.path.exists(os.path.join(
747+
home, '.matplotlib', 'matplotlibrc'))):
749748
warnings.warn(
750749
"Found matplotlib configuration in ~/.matplotlib/. "
751750
"To conform with the XDG base directory standard, "
@@ -754,6 +753,8 @@ def matplotlib_fname():
754753
"Please move your configuration there to ensure that "
755754
"matplotlib will continue to find it in the future." %
756755
_get_xdg_config_dir())
756+
return os.path.join(
757+
home, '.matplotlib', 'matplotlibrc')
757758
return fname
758759

759760
path = get_data_path() # guaranteed to exist or raise

0 commit comments

Comments
 (0)