Skip to content

Commit 9611266

Browse files
clayoteT-Dynamos
andauthored
Patch out the ast.Str reference in Kivy, for Python 3.14 compatibility (#3241)
* `python`: update to `3.14.0` * Patch out the reference to `ast.Str` in `kivy.lang.parser` It broke Python 3.14, and I don't think Kivy even supports Python 3.6 anymore --------- Co-authored-by: Ansh Dadwal <[email protected]>
1 parent 9720dbd commit 9611266

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

pythonforandroid/recipes/kivy/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ class KivyRecipe(PyProjectRecipe):
3232
# sdl-gl-swapwindow-nogil.patch is needed to avoid a deadlock.
3333
# See: https://github.com/kivy/kivy/pull/8025
3434
# WARNING: Remove this patch when a new Kivy version is released.
35-
patches = [("sdl-gl-swapwindow-nogil.patch", is_kivy_affected_by_deadlock_issue), "use_cython.patch"]
35+
patches = [
36+
("sdl-gl-swapwindow-nogil.patch", is_kivy_affected_by_deadlock_issue),
37+
"use_cython.patch",
38+
"no-ast-str.patch"
39+
]
3640

3741
@property
3842
def need_stl_shared(self):
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff -ur kivy-2.3.1b/kivy/lang/parser.py kivy-2.3.1/kivy/lang/parser.py
2+
--- kivy-2.3.1b/kivy/lang/parser.py 2025-10-19 13:04:51.542798827 +1300
3+
+++ kivy-2.3.1/kivy/lang/parser.py 2025-10-19 13:05:16.007104601 +1300
4+
@@ -230,11 +230,7 @@
5+
6+
if isinstance(node, (ast.JoinedStr, ast.BoolOp)):
7+
for n in node.values:
8+
- if isinstance(n, ast.Str):
9+
- # NOTE: required for python3.6
10+
- yield from cls.get_names_from_expression(n.s)
11+
- else:
12+
- yield from cls.get_names_from_expression(n.value)
13+
+ yield from cls.get_names_from_expression(n.value)
14+
15+
if isinstance(node, ast.BinOp):
16+
yield from cls.get_names_from_expression(node.right)

0 commit comments

Comments
 (0)