File: numpy_2.3_strokemap.patch

package info (click to toggle)
mypaint 2.0.1-14
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,884 kB
  • sloc: python: 43,893; cpp: 6,931; xml: 2,475; sh: 473; makefile: 25
file content (30 lines) | stat: -rw-r--r-- 988 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Forwarded: not-needed
Origin: https://github.com/mypaint/mypaint/commit/2a92b6baf452aba2cff3cc0a7782b301da3933d7

From 2a92b6baf452aba2cff3cc0a7782b301da3933d7 Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Sun, 4 Aug 2024 05:41:28 +0200
Subject: [PATCH] strokemap: Replace deprecated tostring with tobytes

https: //numpy.org/devdocs/reference/generated/numpy.ndarray.tostring.html#numpy.ndarray.tostring

--- a/lib/strokemap.py
+++ b/lib/strokemap.py
@@ -411,7 +411,7 @@
 
     """
 
-    _ZDATA_ONES = zlib.compress(np.ones((N, N), 'uint8').tostring())
+    _ZDATA_ONES = zlib.compress(np.ones((N, N), 'uint8').tobytes())
 
     def __init__(self):
         """Initialize, as a tile filled with all ones."""
@@ -451,7 +451,7 @@
             tile._zdata = None
         else:
             tile._all = False
-            tile._zdata = zlib.compress(array.tostring())
+            tile._zdata = zlib.compress(array.tobytes())
         return tile
 
     @classmethod