File tree 2 files changed +14
-7
lines changed 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change
1
+ :orphan:
2
+
3
+ The MATPLOTLIBRC environment variable can now point to any "file" path
4
+ ``````````````````````````````````````````````````````````````````````
5
+
6
+ This includes device files; in particular, on Unix systems, one can set
7
+ ``MATPLOTLIBRC `` to ``/dev/null `` to ignore the user's matplotlibrc file and
8
+ fall back to Matplotlib's defaults.
9
+
10
+ As a reminder, if ``MATPLOTLIBRC `` points to a directory, Matplotlib will try
11
+ to load the matplotlibrc file from ``$MATPLOTLIBRC/matplotlibrc ``.
Original file line number Diff line number Diff line change 130
130
import pprint
131
131
import re
132
132
import shutil
133
- import stat
134
133
import subprocess
135
134
import tempfile
136
135
import urllib .request
@@ -708,8 +707,7 @@ def matplotlib_fname():
708
707
709
708
- `$PWD/matplotlibrc`
710
709
711
- - `$MATPLOTLIBRC` if it is a file (or a named pipe, which can be created
712
- e.g. by process substitution)
710
+ - `$MATPLOTLIBRC` if it is not a directory
713
711
714
712
- `$MATPLOTLIBRC/matplotlibrc`
715
713
@@ -744,10 +742,8 @@ def gen_candidates():
744
742
yield os .path .join (get_data_path (), 'matplotlibrc' )
745
743
746
744
for fname in gen_candidates ():
747
- if os .path .exists (fname ):
748
- st_mode = os .stat (fname ).st_mode
749
- if stat .S_ISREG (st_mode ) or stat .S_ISFIFO (st_mode ):
750
- break
745
+ if os .path .exists (fname ) and not os .path .isdir (fname ):
746
+ break
751
747
# Return first candidate that is a file, or last candidate if none is
752
748
# valid (in that case, a warning is raised at startup by `rc_params`).
753
749
return fname
You can’t perform that action at this time.
0 commit comments