8000 Merge pull request #19507 from tacaswell/fix_no_cwd · matplotlib/matplotlib@08179da · GitHub
[go: up one dir, main page]

Skip to content

Commit 08179da

Browse files
authored
Merge pull request #19507 from tacaswell/fix_no_cwd
FIX: ensure we import when the user cwd does not exist
2 parents 140ed40 + 0366c46 commit 08179da

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,11 @@ def matplotlib_fname():
496496
"""
497497

498498
def gen_candidates():
499-
yield os.path.join(os.getcwd(), 'matplotlibrc')
499+
# rely on down-stream code to make absolute. This protects us
500+
# from having to directly get the current working directory
501+
# which can fail if the user has ended up with a cwd that is
502+
# non-existent.
503+
yield 'matplotlibrc'
500504
try:
501505
matplotlibrc = os.environ['MATPLOTLIBRC']
502506
except KeyError:

0 commit comments

Comments
 (0)
0