8000 Merge pull request #22768 from tacaswell/fix_inkscape · matplotlib/matplotlib@f1c3444 · GitHub
[go: up one dir, main page]

Skip to content

Commit f1c3444

Browse files
authored
Merge pull request #22768 from tacaswell/fix_inkscape
Fix inkscape tests
2 parents 574580c + 9e5fe13 commit f1c3444

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/testing/compare.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ def __call__(self, orig, dest):
147147
weakref.finalize(self._tmpdir, self.__del__)
148148
if (not self._proc # First run.
149149
or self._proc.poll() is not None): # Inkscape terminated.
150+
if self._proc is not None and self._proc.poll() is not None:
151+
for stream in filter(None, [self._proc.stdin,
152+
self._proc.stdout,
153+
self._proc.stderr]):
154+
stream.close()
150155
env = {
151156
**os.environ,
152157
# If one passes e.g. a png file to Inkscape, it will try to
@@ -156,7 +161,7 @@ def __call__(self, orig, dest):
156161
# just be reported as a regular exception below).
157162
"DISPLAY": "",
158163
# Do not load any user options.
159-
"INKSCAPE_PROFILE_DIR": os.devnull,
164+
"INKSCAPE_PROFILE_DIR": self._tmpdir.name,
160165
}
161166
# Old versions of Inkscape (e.g. 0.48.3.1) seem to sometimes
162167
# deadlock when stderr is redirected to a pipe, so we redirect it

0 commit comments

Comments
 (0)
0