File: cython-3.1.patch

package info (click to toggle)
kivy 2.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,316 kB
  • sloc: python: 80,678; ansic: 5,326; javascript: 780; objc: 725; lisp: 195; sh: 173; makefile: 150
file content (63 lines) | stat: -rw-r--r-- 2,481 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From: Mirko Galimberti <me@mirkogalimberti.com>
Date: Tue, 13 May 2025 21:35:00 +0200
Subject: Remove old Python 2 long from Cython files,
 fixes build with Cython 3.1.x

Origin: upstream, https://github.com/kivy/kivy/pull/9056
Bug-Debian: https://bugs.debian.org/1119744
Last-Update: 2025-11-02
---
 kivy/graphics/context_instructions.pyx | 2 +-
 kivy/graphics/opengl.pyx               | 4 ++--
 kivy/weakproxy.pyx                     | 3 ---
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/kivy/graphics/context_instructions.pyx b/kivy/graphics/context_instructions.pyx
index b314831..49e8f28 100644
--- a/kivy/graphics/context_instructions.pyx
+++ b/kivy/graphics/context_instructions.pyx
@@ -86,7 +86,7 @@ cdef tuple rgb_to_hsv(float r, float g, float b):
 
 cdef tuple hsv_to_rgb(float h, float s, float v):
     if s == 0.0: return v, v, v
-    cdef long i = long(h * 6.0)
+    cdef long i = <long>(h * 6.0)
     cdef float f = (h * <float>6.0) - i
     cdef float p = v * (<float>1.0 - s)
     cdef float q = v * (<float>1.0 - s * f)
diff --git a/kivy/graphics/opengl.pyx b/kivy/graphics/opengl.pyx
index cd249a3..d4ad561 100644
--- a/kivy/graphics/opengl.pyx
+++ b/kivy/graphics/opengl.pyx
@@ -689,7 +689,7 @@ def glDrawElements(GLenum mode, GLsizei count, GLenum type, indices):
     cdef void *ptr = NULL
     if isinstance(indices, bytes):
         ptr = <void *>(<char *>(<bytes>indices))
-    elif isinstance(indices, (long, int)):
+    elif isinstance(indices, int):
         ptr = <void *>(<unsigned int>indices)
     else:
         raise TypeError("Argument 'indices' has incorrect type (expected bytes or int).")
@@ -1539,7 +1539,7 @@ def glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean norma
     cdef void *ptr = NULL
     if isinstance(data, bytes):
         ptr = <void *>(<char *>(<bytes>data))
-    elif isinstance(data, (long, int)):
+    elif isinstance(data, int):
         ptr = <void *>(<unsigned int>data)
     else:
         raise TypeError("Argument 'data' has incorrect type (expected bytes or int).")
diff --git a/kivy/weakproxy.pyx b/kivy/weakproxy.pyx
index a6291b4..7d49812 100644
--- a/kivy/weakproxy.pyx
+++ b/kivy/weakproxy.pyx
@@ -253,9 +253,6 @@ cdef class WeakProxy(object):
     def __int__(self):
         return int(self.__ref__())
 
-    def __long__(self):
-        return long(self.__ref__())
-
     def __float__(self):
         return float(self.__ref__())