Skip to content

Commit fd4c0c4

Browse files
committed
Increase memory allocation for site packages dir.
Only interpolate once to prevent snprintf weirdness.
1 parent a733b3c commit fd4c0c4

File tree

1 file changed

+5
-4
lines changed
  • pythonforandroid/bootstraps/common/build/jni/application/src

1 file changed

+5
-4
lines changed

pythonforandroid/bootstraps/common/build/jni/application/src/start.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,13 @@ static int run_python(int argc, char *argv[], bool call_exit, char* argument_val
223223
*/
224224
PyRun_SimpleString("import io, sys, posix\n");
225225

226-
char add_site_packages_dir[256];
226+
char add_site_packages_dir[512];
227227

228228
if (dir_exists(python_bundle_dir)) {
229-
snprintf(add_site_packages_dir, 256,
230-
"if '%s/site-packages' not in sys.path:\n"
231-
" sys.path.append('%s/site-packages')\n",
229+
snprintf(add_site_packages_dir, 512,
230+
"site_packages_path = '%s/site-packages'\n"
231+
"if site_packages_path not in sys.path:\n"
232+
" sys.path.append(site_packages_path)",
232233
python_bundle_dir);
233234

234235
PyRun_SimpleString("import sys\n"

0 commit comments

Comments
 (0)