@@ -544,23 +544,10 @@ def _get_config_or_cache_dir(xdg_base):
544
544
return configdir
545
545
546
546
h = get_home ()
547
- if sys .platform .startswith ('linux' ):
548
- xdg_path = os .path .join (xdg_base , 'matplotlib' )
549
-
550
- p = os .path .join (h , '.matplotlib' )
551
- if os .path .exists (p ):
552
- warnings .warn (
553
- "Found matplotlib configuration in ~/.matplotlib. "
554
- "To conform with the XDG base directory standard, "
555
- "this configuration directory has been deprecated "
556
- "on Linux, and the new location is now %r. Please "
557
- "move your configuration there to ensure that "
558
- "matplotlib will continue to find it in the future." %
559
- xdg_path )
560
- else :
561
- p = xdg_path
562
- else :
563
- p = os .path .join (h , '.matplotlib' )
547
+ p = os .path .join (h , '.matplotlib' )
548
+ if (sys .platform .startswith ('linux' ) and
549
+ not os .path .exists (p )):
550
+ p = _get_xdg_config_dir ()
564
551
565
552
if os .path .exists (p ):
566
553
if not _is_writable_dir (p ):
@@ -726,6 +713,17 @@ def matplotlib_fname():
726
713
if configdir is not None :
727
714
fname = os .path .join (configdir , 'matplotlibrc' )
728
715
if os .path .exists (fname ):
716
+ if (sys .platform .startswith ('linux' ) and
717
+ fname == os .path .join (
718
+ get_home (), '.matplotlib' , 'matplotlibrc' )):
719
+ warnings .warn (
720
+ "Found matplotlib configuration in ~/.matplotlib. "
721
+ "To conform with the XDG base directory standard, "
722
+ "this configuration location has been deprecated "
723
+ "on Linux, and the new location is now %r. Please "
724
+ "move your configuration there to ensure that "
725
+ "matplotlib will continue to find it in the future." %
726
+ _get_xdg_config_dir ())
729
727
return fname
730
728
731
729
path = get_data_path () # guaranteed to exist or raise
0 commit comments