Skip to content

Commit c3d94d9

Browse files
committed
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
1 parent 66f98db commit c3d94d9

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected static ArrayList<String> getLibraries(File libsDir) {
5151
addLibraryIfExists(libsList, name, libsDir);
5252
}
5353

54-
for (int v = 14; v >= 5; v--) {
54+
for (int v = 5; v <= 14; v++) {
5555
libsList.add("python3." + v + (v <= 7 ? "m" : ""));
5656
}
5757

pythonforandroid/recipes/hostpython3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class HostPython3Recipe(Recipe):
3636
:class:`~pythonforandroid.python.HostPythonRecipe`
3737
'''
3838

39-
version = '3.14.0'
39+
version = '3.11.13'
4040

4141
url = 'https://github.com/python/cpython/archive/refs/tags/v{version}.tar.gz'
4242
'''The default url to download our host python recipe. This url will

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)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from pythonforandroid.recipe import PythonRecipe
2+
3+
4+
class SixRecipe(PythonRecipe):
5+
version = '1.15.0'
6+
url = 'https://pypi.python.org/packages/source/s/six/six-{version}.tar.gz'
7+
depends = ['setuptools']
8+
9+
10+
recipe = SixRecipe()

0 commit comments

Comments
 (0)