Skip to content

Commit 632047c

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

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
@@ -229,12 +229,13 @@ static int run_python(int argc, char *argv[], bool call_exit, char* argument_val
229229
*/
230230
PyRun_SimpleString("import io, sys, posix\n");
231231

232-
char add_site_packages_dir[256];
232+
char add_site_packages_dir[512];
233233

234234
if (dir_exists(python_bundle_dir)) {
235-
snprintf(add_site_packages_dir, 256,
236-
"if '%s/site-packages' not in sys.path:\n"
237-
" sys.path.append('%s/site-packages')\n",
235+
snprintf(add_site_packages_dir, 512,
236+
"site_packages_path = '%s/site-packages'\n"
237+
"if site_packages_path not in sys.path:\n"
238+
" sys.path.append(site_packages_path)",
238239
python_bundle_dir);
239240

240241
PyRun_SimpleString("import sys\n"

0 commit comments

Comments
 (0)