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

Skip to content

Commit df8c010

Browse files
committed
Flush file handles at the end, since Python 3 won't do it for us.
1 parent 87cf619 commit df8c010

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/backends/backend_ps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@ def write(self, *kl, **kwargs):
11791179
print("end", file=fh)
11801180
print("showpage", file=fh)
11811181
if not isEPSF: print("%%EOF", file=fh)
1182+
fh.flush()
11821183

11831184
if rcParams['ps.usedistiller'] == 'ghostscript':
11841185
gs_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox)
@@ -1293,6 +1294,7 @@ def write(self, *kl, **kwargs):
12931294
#print >>fh, "grestore"
12941295
print("end", file=fh)
12951296
print("showpage", file=fh)
1297+
fh.flush()
12961298

12971299
if isLandscape: # now we are ready to rotate
12981300
isLandscape = True

0 commit comments

Comments
 (0)