Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a82de5c

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

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/__init__.py

Lines 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)