Skip to content

Commit a625a90

Browse files
committed
Checked py version before 'import site' in start.c
1 parent 09ea5b4 commit a625a90

File tree

1 file changed

+4
-1
lines changed
  • pythonforandroid/bootstraps/sdl2/build/jni/src

1 file changed

+4
-1
lines changed

pythonforandroid/bootstraps/sdl2/build/jni/src/start.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,15 @@ int main(int argc, char *argv[]) {
234234
" def flush(self):\n" \
235235
" return\n" \
236236
"sys.stdout = sys.stderr = LogFile()\n" \
237-
"import site; print(site.getsitepackages())\n"
238237
"print('Android path', sys.path)\n" \
239238
"import os\n" \
240239
"print('os.environ is', os.environ)\n" \
241240
"print('Android kivy bootstrap done. __name__ is', __name__)");
242241

242+
#if PY_MAJOR_VERSION < 3
243+
PyRun_SimpleString("import site; print site.getsitepackages()\n");
244+
#endif
245+
243246
/* PyRun_SimpleString( */
244247
/* "import sys, posix\n" \ */
245248
/* "private = posix.environ['ANDROID_PRIVATE']\n" \ */

0 commit comments

Comments
 (0)