summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool')
-rw-r--r--scripts/lib/devtool/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index e675133f63..31ecb65937 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -23,6 +23,7 @@ import sys
23import subprocess 23import subprocess
24import logging 24import logging
25import re 25import re
26import codecs
26 27
27logger = logging.getLogger('devtool') 28logger = logging.getLogger('devtool')
28 29
@@ -67,10 +68,10 @@ def exec_watch(cmd, **options):
67 cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **options 68 cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **options
68 ) 69 )
69 70
71 reader = codecs.getreader('utf-8')(process.stdout)
70 buf = '' 72 buf = ''
71 while True: 73 while True:
72 out = process.stdout.read(1) 74 out = reader.read(1, 1)
73 out = out.decode('utf-8')
74 if out: 75 if out:
75 sys.stdout.write(out) 76 sys.stdout.write(out)
76 sys.stdout.flush() 77 sys.stdout.flush()