Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/matplotlib/testing/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import subprocess
import sys
from tempfile import TemporaryDirectory, TemporaryFile
import weakref

import numpy as np
from PIL import Image
Expand Down Expand Up @@ -170,6 +171,9 @@ def __call__(self, orig, dest):
terminator = b"\n>" if old_inkscape else b"> "
if not hasattr(self, "_tmpdir"):
self._tmpdir = TemporaryDirectory()
# On Windows, we must make sure that self._proc has terminated
# (which __del__ does) before clearing _tmpdir.
weakref.finalize(self._tmpdir, self.__del__)
if (not self._proc # First run.
or self._proc.poll() is not None): # Inkscape terminated.
env = {
Expand Down