add python3 compatibility to verbose output for android build (#221)

This cause, that stdout is text file, but codecs.StreamWriter encodes string to bytes.
This commit is contained in:
pohmelie 2016-03-14 02:49:54 +03:00
parent 768bb5c8f6
commit 10333efcaf

View file

@ -351,7 +351,10 @@ class Buildozer(object):
show_output = kwargs.pop('show_output') show_output = kwargs.pop('show_output')
if show_output: if show_output:
kwargs['logfile'] = codecs.getwriter('utf8')(stdout) if IS_PY3:
kwargs['logfile'] = codecs.getwriter('utf8')(stdout.buffer)
else:
kwargs['logfile'] = codecs.getwriter('utf8')(stdout)
if not sensible: if not sensible:
self.debug('Run (expect) {0!r}'.format(command)) self.debug('Run (expect) {0!r}'.format(command))