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

Skip to content

Commit 045c951

Browse files
authored
Merge pull request #9869 from anntzer/clean-tmpdir
Clean tmpdir at exit.
2 parents a5fb352 + 9f8b0f5 commit 045c951

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104

105105
import six
106106

107+
import atexit
107108
from collections import MutableMapping
108109
import contextlib
109110
import distutils.version
@@ -116,6 +117,7 @@
116117
import logging
117118
import os
118119
import re
120+
import shutil
119121
import sys
120122
import tempfile
121123
import warnings
@@ -605,6 +607,7 @@ def _create_tmp_config_dir():
605607
"""
606608
configdir = os.environ['MPLCONFIGDIR'] = (
607609
tempfile.mkdtemp(prefix='matplotlib-'))
610+
atexit.register(shutil.rmtree, configdir)
608611
return configdir
609612

610613

0 commit comments

Comments
 (0)