8000 Fix issue #4597 · matplotlib/matplotlib@5ff5c90 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5ff5c90

Browse files
author
Kanwar245
committed
Fix issue #4597
1 parent 4063fa5 commit 5ff5c90

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/matplotlib/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,16 +553,14 @@ def _create_tmp_config_dir():
553553
# Some restricted platforms (such as Google App Engine) do not provide
554554
# gettempdir.
555555
return None
556-
557556
try:
558557
username = getpass.getuser()
559558
except KeyError:
560559
username = str(os.getuid())
561-
tempdir = os.path.join(tempdir, 'matplotlib-%s' % username)
562560

563-
os.environ['MPLCONFIGDIR'] = tempdir
561+
tempdir = tempfile.mkdtemp(prefix='matplotlib-%s-' % username, dir=tempdir)
564562

565-
mkdirs(tempdir)
563+
os.environ['MPLCONFIGDIR'] = tempdir
566564

567565
return tempdir
568566

0 commit comments

Comments
 (0)
0