8000 Added py2/py3 .so load in sdl2 bootstrap · kived/python-for-android@9fb3af2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9fb3af2

Browse files
committed
Added py2/py3 .so load in sdl2 bootstrap
1 parent 411555d commit 9fb3af2

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonActivity.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ protected String[] getLibraries() {
9393
"SDL2_image",
9494
"SDL2_mixer",
9595
"SDL2_ttf",
96-
"python2.7",
9796
"main"
9897
};
9998
}
@@ -104,9 +103,25 @@ public void loadLibraries() {
104103
System.loadLibrary(lib);
105104
}
106105

107-
System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_io.so");
108-
System.load(getFilesDir() + "/lib/python2.7/lib-dynload/unicodedata.so");
109-
106+
try {
107+
System.loadLibrary("python2.7");
108+
} catch(UnsatisfiedLinkError e) {
109+
Log.v(TAG, "Failed to load libpython2.7");
110+
}
111+
112+
try {
113+
System.loadLibrary("python3.5m");
114+
} catch(UnsatisfiedLinkError e) {
115+
Log.v(TAG, "Failed to load libpython3.5m");
116+
}
117+
118+
try {
119+
System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_io.so");
120+
System.load(getFilesDir() + "/lib/python2.7/lib-dynload/unicodedata.so");
121+
} catch(UnsatisfiedLinkError e) {
122+
Log.v(TAG, "Failed to load _io.so or unicodedata.so...but that's okay.");
123+
}
124+
110125
try {
111126
// System.loadLibrary("ctypes");
112127
System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_ctypes.so");

0 commit comments

Comments
 (0)
0