fixes python2 console write (as before)

This commit is contained in:
Mathieu Virbel 2014-04-21 01:19:21 +02:00
parent e6495349b8
commit 7b4efe3c0e
2 changed files with 16 additions and 4 deletions

View file

@ -1,3 +1,9 @@
### 0.14
(April 21st, 2014)
- More fixes for linux console on Python 2
### 0.13
(April 21st, 2014)

View file

@ -6,7 +6,7 @@ Generic Python packager for Android / iOS. Desktop later.
'''
__version__ = '0.13'
__version__ = '0.14'
import os
import re
@ -66,7 +66,7 @@ except ImportError:
LOG_LEVELS_C = (RED, BLUE, BLACK)
LOG_LEVELS_T = 'EID'
SIMPLE_HTTP_SERVER_PORT = 8000
IS_PY3 = sys.version_info[0] >= 3
class ChromeDownloader(FancyURLopener):
version = (
@ -290,7 +290,10 @@ class Buildozer(object):
if get_stdout:
ret_stdout.append(chunk)
if show_output:
stdout.write(chunk.decode('utf-8'))
if IS_PY3:
stdout.write(chunk.decode('utf-8'))
else:
stdout.write(chunk)
if fd_stderr in readx:
chunk = process.stderr.read()
if not chunk:
@ -298,7 +301,10 @@ class Buildozer(object):
if get_stderr:
ret_stderr.append(chunk)
if show_output:
stderr.write(chunk.decode('utf-8'))
if IS_PY3:
stderr.write(chunk.decode('utf-8'))
else:
stderr.write(chunk)
stdout.flush()
stderr.flush()