diff --git a/pythonforandroid/logger.py b/pythonforandroid/logger.py index 64d5f2c452..75fee40d1a 100644 --- a/pythonforandroid/logger.py +++ b/pythonforandroid/logger.py @@ -173,9 +173,9 @@ def shprint(command, *args, **kwargs): msg_width = columns - len(msg_hdr) - 1 output = command(*args, **kwargs) for line in output: + if isinstance(line, bytes): + line = line.decode('utf-8', errors='replace') if logger.level > logging.DEBUG: - if isinstance(line, bytes): - line = line.decode('utf-8', errors='replace') msg = line.replace( '\n', ' ').replace( '\t', ' ').replace(