8000 Use six.BytesIO rather than a monkey patch. · htylab/matplotlib@cdf50a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit cdf50a5

Browse files
committed
Use six.BytesIO rather than a monkey patch.
1 parent 2f20e82 commit cdf50a5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/matplotlib/backends/backend_webagg.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import datetime
1919
import errno
20-
import io
2120
import json
2221
import os
2322
import random
@@ -197,13 +196,7 @@ def get(self, fignum, fmt):
197196

198197
self.set_header('Content-Type', mimetypes.get(fmt, 'binary'))
199198

200-
# override fileno to raise AttributeError to prevent PIL error
201-
class BytesIO(io.BytesIO):
202-
@property
203-
def fileno(self):
204-
raise AttributeError
205-
206-
buff = BytesIO()
199+
buff = six.BytesIO()
207200
manager.canvas.print_figure(buff, format=fmt)
208201
self.write(buff.getvalue())
209202

0 commit comments

Comments
 (0)
0