new file mode 100644
@@ -0,0 +1,34 @@
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Sun, 29 Nov 2026 00:00:00 -0800
+Subject: [PATCH] graphics/instructions: Drop the Python 2 branch in
+ RenderContext.apply()
+
+Cython 3.3 infers dict.keys() as a dict_keys object and rejects assigning
+it to the "cdef list keys" variable, even in the dead PY2 branch:
+
+ kivy/graphics/instructions.pyx:899:41: Cannot assign type 'dict_keys object' to 'list object'
+
+Upstream master removed all Python 2 compatibility code; take just this
+hunk.
+
+Upstream-Status: Backport [https://github.com/kivy/kivy/commit/dcd8fb2a6ae3f96789d51e00e1ff2f3c2fc339ef]
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ kivy/graphics/instructions.pyx | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/kivy/graphics/instructions.pyx b/kivy/graphics/instructions.pyx
+--- a/kivy/graphics/instructions.pyx
++++ b/kivy/graphics/instructions.pyx
+@@ -895,10 +895,7 @@ cdef class RenderContext(Canvas):
+
+ cdef int apply(self) except -1:
+ cdef list keys
+- if PY2:
+- keys = self.state_stacks.keys()
+- else:
+- keys = list(self.state_stacks.keys())
++ keys = list(self.state_stacks.keys())
+
+ cdef RenderContext active_context = getActiveContext()
+ if self._use_parent_projection:
@@ -12,6 +12,7 @@ inherit setuptools3 pkgconfig features_check cython
# Also, if using SDL2 as backend, SDL2 needs to be configured with gles
SRC_URI = "git://github.com/kivy/kivy.git;protocol=https;branch=stable \
file://0001-add-support-for-glesv2.patch \
+ file://0002-graphics-instructions-Drop-the-Python-2-branch-in-Re.patch \
"
SRCREV = "ec09ee880c666e70de42501f36dbc43e349e3712"
Cython 3.3 infers dict.keys() as a dict_keys object and rejects storing it in a "cdef list" variable, even in kivy's dead Python 2 branch: kivy/graphics/instructions.pyx:899:41: Cannot assign type 'dict_keys object' to 'list object' Backport the hunk of upstream's Python 2 compatibility removal that drops this branch. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> --- ...tions-Drop-the-Python-2-branch-in-Re.patch | 34 +++++++++++++++++++ .../python/python3-kivy_2.3.2.bb | 1 + 2 files changed, 35 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-kivy/0002-graphics-instructions-Drop-the-Python-2-branch-in-Re.patch