File tree 1 file changed +7
-3
lines changed 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 117
117
import os
118
118
import re
119
119
import shutil
120
+ import stat
120
121
import sys
121
122
import tempfile
122
123
import warnings
@@ -792,7 +793,8 @@ def matplotlib_fname():
792
793
793
794
- `$PWD/matplotlibrc`
794
795
795
- - `$MATPLOTLIBRC` if it is a file
796
+ - `$MATPLOTLIBRC` if it is a file (or a named pipe, which can be created
797
+ e.g. by process substitution)
796
798
797
799
- `$MATPLOTLIBRC/matplotlibrc`
798
800
@@ -827,8 +829,10 @@ def gen_candidates():
827
829
yield os .path .join (get_data_path (), 'matplotlibrc' )
828
830
829
831
for fname in gen_candidates ():
830
- if os .path .isfile (fname ):
831
- break
832
+ if os .path .exists (fname ):
833
+ st_mode = os .stat (fname ).st_mode
834
+ if stat .S_ISREG (st_mode ) or stat .S_ISFIFO (st_mode ):
835
+ break
832
836
# Return first candidate that is a file, or last candidate if none is
833
837
# valid (in that case, a warning is raised at startup by `rc_params`).
834
838
return fname
You can’t perform that action at this time.
0 commit comments