@@ -639,8 +639,10 @@ def _get_config_or_cache_dir(xdg_base):
639
639
h = get_home ()
640
640
if h is not None :
641
641
p = os .path .join (h , '.matplotlib' )
642
- if (sys .platform .startswith ('linux' ) and xdg_base ):
643
- p = os .path .join (xdg_base , 'matplotlib' )
642
+ if sys .platform .startswith ('linux' ):
643
+ p = None
644
+ if xdg_base is not None :
645
+ p = os .path .join (xdg_base , 'matplotlib' )
644
646
645
647
if p is not None :
646
648
if os .path .exists (p ):
@@ -665,9 +667,8 @@ def _get_configdir():
665
667
666
668
1. If the MPLCONFIGDIR environment variable is supplied, choose that.
667
669
668
- 2a. On Linux, if `$HOME/.matplotlib` exists, choose that, but warn that
669
- that is the old location. Barring that, follow the XDG specification
670
- and look first in `$XDG_CONFIG_HOME`, if defined, or `$HOME/.config`.
670
+ 2a. On Linux, follow the XDG specification and look first in
671
+ `$XDG_CONFIG_HOME`, if defined, or `$HOME/.config`.
671
672
672
673
2b. On other platforms, choose `$HOME/.matplotlib`.
673
674
@@ -794,9 +795,7 @@ def matplotlib_fname():
794
795
795
796
- On Linux,
796
797
797
- - `$HOME/.matplotlib/matplotlibrc`, if it exists
798
-
799
- - or `$XDG_CONFIG_HOME/matplotlib/matplotlibrc` (if
798
+ - `$XDG_CONFIG_HOME/matplotlib/matplotlibrc` (if
800
799
$XDG_CONFIG_HOME is defined)
801
800
802
801
- or `$HOME/.config/matplotlib/matplotlibrc` (if
@@ -827,24 +826,9 @@ def matplotlib_fname():
827
826
return fname
828
827
829
828
configdir = _get_configdir ()
830
- if configdir is not None :
829
+ if os . path . exists ( configdir ) :
831
830
fname = os .path .join (configdir , 'matplotlibrc' )
832
831
if os .path .exists (fname ):
833
- home = get_home ()
834
- if (sys .platform .startswith ('linux' ) and
835
- home is not None and
836
- os .path .exists (os .path .join (
837
- home , '.matplotlib' , 'matplotlibrc' ))):
838
- warnings .warn (
839
- "Found matplotlib configuration in ~/.matplotlib/. "
840
- "To conform with the XDG base directory standard, "
841
- "this configuration location has been deprecated "
842
- "on Linux, and the new location is now %s/matplotlib/. "
843
- "Please move your configuration there to ensure that "
844
- "matplotlib will continue to find it in the future." %
845
- _get_xdg_config_dir ())
846
- return os .path .join (
847
- home , '.matplotlib' , 'matplotlibrc' )
848
832
return fname
849
833
850
834
path = get_data_path () # guaranteed to exist or raise
0 commit comments