8000 FIX: ensure we import when the user cwd does not exist by tacaswell · Pull Request #19507 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

FIX: ensure we import when the user cwd does not exist #19507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 17, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,11 @@ def matplotlib_fname():
"""

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