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

Skip to content

Commit 9c2cf4c

Browse files
committed
More Python 2.6 compatibility
1 parent 5085af7 commit 9c2cf4c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/matplotlib/backends/backend_pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,12 +1295,12 @@ def _writePng(self, data):
12951295
while True:
12961296
n = buffer.readinto(header)
12971297
assert n == 8
1298-
length, type = struct.unpack(b'!L4s', header)
1298+
length, type = struct.unpack(b'!L4s', bytes(header))
12991299
if type == b'IDAT':
13001300
data = bytearray(length)
13011301
n = buffer.readinto(data)
13021302
assert n == length
1303-
self.currentstream.write(data)
1303+
self.currentstream.write(bytes(data))
13041304
written += n
13051305
elif type == b'IEND':
13061306
break

0 commit comments

Comments
 (0)