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

Skip to content

Commit 74fc63d

Browse files
committed
Create directory specified by MPLCONFIGDIR if it does not exist.
svn path=/trunk/matplotlib/; revision=8609
1 parent 914eb85 commit 74fc63d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2010-08-01 Create directory specified by MPLCONFIGDIR if it does
2+
not exist. - ADS
3+
14
2010-07-20 Return Qt4's default cursor when leaving the canvas - DSD
25

36
2010-07-06 Tagging for mpl 1.0 at r8502

lib/matplotlib/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,8 @@ def _get_configdir():
456456

457457
configdir = os.environ.get('MPLCONFIGDIR')
458458
if configdir is not None:
459+
if not os.path.exists(configdir):
460+
os.makedirs(configdir)
459461
if not _is_writable_dir(configdir):
460462
raise RuntimeError('Could not write to MPLCONFIGDIR="%s"'%configdir)
461463
return configdir

0 commit comments

Comments
 (0)