@@ -171,9 +171,9 @@ int main(int argc, char *argv[]) {
171
171
172
172
Py_Initialize ();
173
173
174
- if ( dir_exists ( "private/" )) {
175
- PySys_SetArgv (argc , argv );
176
- }
174
+ # if PY_MAJOR_VERSION < 3
175
+ PySys_SetArgv (argc , argv );
176
+ #endif
177
177
178
178
LOG ("Initialized python" );
179
179
@@ -193,8 +193,9 @@ int main(int argc, char *argv[]) {
193
193
* replace sys.path with our path
194
194
*/
195
195
PyRun_SimpleString ("import sys, posix\n" );
196
- if (dir_exists ("private/ " )) {
196
+ if (dir_exists ("lib " )) {
197
197
/* If we built our own python, set up the paths correctly */
198
+ LOG ("Setting up python from ANDROID_PRIVATE" );
198
199
PyRun_SimpleString (
199
200
"private = posix.environ['ANDROID_PRIVATE']\n" \
200
201
"argument = posix.environ['ANDROID_ARGUMENT']\n" \
@@ -204,7 +205,9 @@ int main(int argc, char *argv[]) {
204
205
" private + '/lib/python2.7/lib-dynload/', \n" \
205
206
" private + '/lib/python2.7/site-packages/', \n" \
206
207
" argument ]\n" );
207
- } else {
208
+ }
209
+
210
+ if (dir_exists ("crystax_python" )) {
208
211
char add_site_packages_dir [256 ];
209
212
snprintf (add_site_packages_dir , 256 , "sys.path.append('%s/crystax_python/site-packages')" ,
210
213
env_argument );
0 commit comments