Skip to content

Commit 52b31c0

Browse files
committed
Merge pull request matplotlib#3309 from jenshnielsen/close_files_pgf
MNT : Explicitly close read and write of Popen process (latex)
2 parents 6204ca8 + 4fd757b commit 52b31c0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/matplotlib/animation.py

+1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def _args(self):
226226
def cleanup(self):
227227
'Clean-up and collect the process used to write the movie file.'
228228
out, err = self._proc.communicate()
229+
self._frame_sink().close()
229230
verbose.report('MovieWriter -- '
230231
'Command stdout:\n%s' % out, level='debug')
231232
verbose.report('MovieWriter -- '

lib/matplotlib/backends/backend_pgf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ def _cleanup(self):
342342
if not os.path.isdir(self.tmpdir):
343343
return
344344
try:
345-
self.latex_stdin_utf8.close()
346345
self.latex.communicate()
347-
self.latex.wait()
346+
self.latex_stdin_utf8.close()
347+
self.latex.stdout.close()
348348
except:
349349
pass
350350
try:

0 commit comments

Comments
 (0)