Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a82de5c

Browse filesBrowse files
author
Eugen Beck
committed
_create_tmp_config_dir() "mkdirs" the returned dir
Fixes #4120
1 parent d58a2a5 commit a82de5c
Copy full SHA for a82de5c

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed

‎lib/matplotlib/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ def _create_tmp_config_dir():
537537
"""
538538
import getpass
539539
import tempfile
540+
from matplotlib.cbook import mkdirs
540541

541542
try:
542543
tempdir = tempfile.gettempdir()
@@ -547,6 +548,11 @@ def _create_tmp_config_dir():
547548
tempdir = os.path.join(tempdir, 'matplotlib-%s' % getpass.getuser())
548549
os.environ['MPLCONFIGDIR'] = tempdir
549550

551+
try:
552+
mkdirs(tempdir)
553+
except OSError:
554+
pass
555+
550556
return tempdir
551557

552558

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.