File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
pythonforandroid/bootstraps/common/build/jni/application/src Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ int main(int argc, char *argv[]) {
206
206
/* inject our bootstrap code to redirect python stdin/stdout
207
207
* replace sys.path with our path
208
208
*/
209
- PyRun_SimpleString ("import sys, posix\n" );
209
+ PyRun_SimpleString ("import io, sys, posix\n" );
210
210
211
211
char add_site_packages_dir [256 ];
212
212
@@ -224,17 +224,19 @@ int main(int argc, char *argv[]) {
224
224
}
225
225
226
226
PyRun_SimpleString (
227
- "class LogFile(object ):\n"
227
+ "class LogFile(io.IOBase ):\n"
228
228
" def __init__(self):\n"
229
229
" self.__buffer = ''\n"
230
+ " def readable(self):\n"
231
+ " return False\n"
232
+ " def writable(self):\n"
233
+ " return True\n"
230
234
" def write(self, s):\n"
231
235
" s = self.__buffer + s\n"
232
236
" lines = s.split('\\n')\n"
233
237
" for l in lines[:-1]:\n"
234
238
" androidembed.log(l.replace('\\x00', ''))\n"
235
239
" self.__buffer = lines[-1]\n"
236
- " def flush(self):\n"
237
- " return\n"
238
240
"sys.stdout = sys.stderr = LogFile()\n"
239
241
"print('Android path', sys.path)\n"
240
242
"import os\n"
You can’t perform that action at this time.
0 commit comments