提交 f9793a12 编写于 作者: S Simon Glass

patman: Update errors and warnings to use stderr

When warnings and errors are produced by tools they should be written to
stderr. Update the tout implementation to handle this.
Signed-off-by: NSimon Glass <sjg@chromium.org>
Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
上级 5f850fb9
......@@ -3232,7 +3232,7 @@ class TestFunctional(unittest.TestCase):
with test_util.capture_sys_output() as (stdout, stderr):
control.ReplaceEntries(updated_fname, None, outdir, [])
self.assertIn("Skipping entry '/u-boot' from missing file",
stdout.getvalue())
stderr.getvalue())
def testReplaceCmdMap(self):
"""Test replacing a file fron an image on the command line"""
......
......@@ -83,7 +83,10 @@ def _Output(level, msg, color=None):
ClearProgress()
if color:
msg = _color.Color(color, msg)
print(msg)
if level < NOTICE:
print(msg, file=sys.stderr)
else:
print(msg)
def DoOutput(level, msg):
"""Output a message to the terminal.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册