File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 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 130130import pprint
131131import re
132132import shutil
133- import stat
134133import subprocess
135134import tempfile
136135import urllib .request
@@ -708,8 +707,7 @@ def matplotlib_fname():
708707
709708 - `$PWD/matplotlibrc`
710709
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
713711
714712 - `$MATPLOTLIBRC/matplotlibrc`
715713
@@ -744,10 +742,8 @@ def gen_candidates():
744742 yield os .path .join (get_data_path (), 'matplotlibrc' )
745743
746744 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
751747 # Return first candidate that is a file, or last candidate if none is
752748 # valid (in that case, a warning is raised at startup by `rc_params`).
753749 return fname
You can’t perform that action at this time.
0 commit comments