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[]) {
206206 /* inject our bootstrap code to redirect python stdin/stdout
207207 * replace sys.path with our path
208208 */
209- PyRun_SimpleString ("import sys, posix\n" );
209+ PyRun_SimpleString ("import io, sys, posix\n" );
210210
211211 char add_site_packages_dir [256 ];
212212
@@ -224,17 +224,19 @@ int main(int argc, char *argv[]) {
224224 }
225225
226226 PyRun_SimpleString (
227- "class LogFile(object ):\n"
227+ "class LogFile(io.IOBase ):\n"
228228 " def __init__(self):\n"
229229 " self.__buffer = ''\n"
230+ " def readable(self):\n"
231+ " return False\n"
232+ " def writable(self):\n"
233+ " return True\n"
230234 " def write(self, s):\n"
231235 " s = self.__buffer + s\n"
232236 " lines = s.split('\\n')\n"
233237 " for l in lines[:-1]:\n"
234238 " androidembed.log(l.replace('\\x00', ''))\n"
235239 " self.__buffer = lines[-1]\n"
236- " def flush(self):\n"
237- " return\n"
238240 "sys.stdout = sys.stderr = LogFile()\n"
239241 "print('Android path', sys.path)\n"
240242 "import os\n"
You can’t perform that action at this time.
0 commit comments