summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYilin Yang <kerker@google.com>2020-11-17 09:52:30 +0800
committerCommit Bot <commit-bot@chromium.org>2020-11-17 16:57:35 +0000
commitd0d3284cc2c8522fd7bc998e71259191067b87d5 (patch)
treec768459710330cb7f38ccef4758364ea332f1fdb
parent51484d77533e60cdfe21902eaf759c3be14df40a (diff)
downloadchrome-ec-d0d3284cc2c8522fd7bc998e71259191067b87d5.tar.gz
fw_update: Pass bytes into `wr_command` function
In `wr_command` function, we use `bytearray` to wrap the bytes argument. However, if we pass a `str` type to `bytearray` constructor, we need to specify the encoding. In this case, we need to use `bytes` here. BUG=b:172978731 BRANCH=master TEST=1. cros_workon --host start hdctools ec-devutils 2. sudo emerge hdctools ec-devutils 3. The fix applies into chroot TEST=ODM verifies in their side Signed-off-by: kerker <kerker@chromium.org> Change-Id: I57609c36e639cd6bd116b6f2f3a1baff02312070 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2543567 Tested-by: Henry Sun <henrysun@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Henry Sun <henrysun@google.com>
-rwxr-xr-xextra/usb_updater/fw_update.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/extra/usb_updater/fw_update.py b/extra/usb_updater/fw_update.py
index 739fa2fe80..910f124c94 100755
--- a/extra/usb_updater/fw_update.py
+++ b/extra/usb_updater/fw_update.py
@@ -257,7 +257,7 @@ class Supdate(object):
offset += pagesize
# Validate that the micro thinks it successfully wrote the data.
- read = self.wr_command("", read_count=4)
+ read = self.wr_command(b"", read_count=4)
result = struct.unpack("<I", read)
result = result[0]
if result != 0: