Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d834d1c

Browse filesBrowse files
committed
Backport PR16958: MAINT: Replace uses of tostring with tobytes
1 parent 114afa7 commit d834d1c
Copy full SHA for d834d1c

File tree

Expand file treeCollapse file tree

3 files changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+4
-4
lines changed

‎lib/matplotlib/backends/backend_pdf.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_pdf.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ def writeGouraudTriangles(self):
13941394
streamarr['points'] = (flat_points - points_min) * factor
13951395
streamarr['colors'] = flat_colors[:, :colordim] * 255.0
13961396

1397-
self.write(streamarr.tostring())
1397+
self.write(streamarr.tobytes())
13981398
self.endStream()
13991399
self.writeObject(self.gouraudObject, gouraudDict)
14001400

@@ -1487,7 +1487,7 @@ def _writeImg(self, data, height, width, grayscale, id, smask=None):
14871487
if png:
14881488
self._writePng(data)
14891489
else:
1490-
self.currentstream.write(data.tostring())
1490+
self.currentstream.write(data.tobytes())
14911491
self.endStream()
14921492

14931493
def writeImages(self):

‎lib/matplotlib/backends/backend_ps.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_ps.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def draw_gouraud_triangles(self, gc, points, colors, trans):
694694
streamarr['points'] = (flat_points - points_min) * factor
695695
streamarr['colors'] = flat_colors[:, :3] * 255.0
696696

697-
stream = quote_ps_string(streamarr.tostring())
697+
stream = quote_ps_string(streamarr.tobytes())
698698

699699
self._pswriter.write(f"""\
700700
gsave

‎lib/matplotlib/backends/backend_wx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_wx.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def draw_image(self, gc, x, y, im):
288288
w = self.width
289289
h = self.height
290290
rows, cols = im.shape[:2]
291-
bitmap = wx.Bitmap.FromBufferRGBA(cols, rows, im.tostring())
291+
bitmap = wx.Bitmap.FromBufferRGBA(cols, rows, im.tobytes())
292292
gc = self.get_gc()
293293
gc.select()
294294
gc.gfx_ctx.DrawBitmap(bitmap, int(l), int(self.height - b),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.