mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-07-06 14:32:03 +00:00
patman: Provide a way to get program output in binary mode
At present cros_subprocess and the tools library use a string to obtain stdout from a program. This works fine on Python 2. With Python 3 we end up with unicode errors in some cases. Fix this by providing a binary mode, which returns the data as bytes() instead of a string. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
3e4b51e8d6
commit
a92939a4aa
2 changed files with 4 additions and 3 deletions
|
@ -167,9 +167,9 @@ def PathHasFile(fname):
|
|||
return True
|
||||
return False
|
||||
|
||||
def Run(name, *args):
|
||||
def Run(name, *args, **kwargs):
|
||||
try:
|
||||
return command.Run(name, *args, cwd=outdir, capture=True)
|
||||
return command.Run(name, *args, cwd=outdir, capture=True, **kwargs)
|
||||
except:
|
||||
if not PathHasFile(name):
|
||||
msg = "Plesae install tool '%s'" % name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue