Skip to content

Commit

Permalink
tc-testing: tdc.py: ignore errors when decoding stdout/stderr
Browse files Browse the repository at this point in the history
Prevent exceptions from being raised while decoding output
from an executed command. There is no impact on tdc's
execution and the verify command phase would fail the pattern
match.

Signed-off-by: Lucas Bates <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Lucas Bates authored and davem330 committed Nov 18, 2018
1 parent 16f7eb2 commit 5aaf642
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/tc-testing/tdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ def exec_cmd(args, pm, stage, command):
(rawout, serr) = proc.communicate()

if proc.returncode != 0 and len(serr) > 0:
foutput = serr.decode("utf-8")
foutput = serr.decode("utf-8", errors="ignore")
else:
foutput = rawout.decode("utf-8")
foutput = rawout.decode("utf-8", errors="ignore")

proc.stdout.close()
proc.stderr.close()
Expand Down

0 comments on commit 5aaf642

Please sign in to comment.