File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 117117import os
118118import re
119119import shutil
120+ import stat
120121import sys
121122import tempfile
122123import warnings
@@ -792,7 +793,8 @@ def matplotlib_fname():
792793
793794 - `$PWD/matplotlibrc`
794795
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)
796798
797799 - `$MATPLOTLIBRC/matplotlibrc`
798800
@@ -827,8 +829,10 @@ def gen_candidates():
827829 yield os .path .join (get_data_path (), 'matplotlibrc' )
828830
829831 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
832836 # Return first candidate that is a file, or last candidate if none is
833837 # valid (in that case, a warning is raised at startup by `rc_params`).
834838 return fname
You can’t perform that action at this time.
0 commit comments