diff options
author | Jules Maselbas <jmaselbas@kalray.eu> | 2023-02-07 17:20:51 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-02-13 10:10:28 +0100 |
commit | afeb39dd0c1d6e46a4a9231ec2c3d1591f83dd31 (patch) | |
tree | af4da9222b2500a9271ea0ef679ad7a8acf398b3 /scripts | |
parent | 6652ffcdab4716f2bf0b3bb75d79069ec1698ec6 (diff) | |
download | barebox-afeb39dd0c1d6e46a4a9231ec2c3d1591f83dd31.tar.gz |
bbremote: Fix default payload value in BBPacket
The payload variable is expected to typeof bytes, however the default
value in BBPacket contructor is of type str, a simple way to declare
a byte literal in Python is to prefix the string literal with `b`.
Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
Link: https://lore.barebox.org/20230207162055.10050-1-jmaselbas@kalray.eu
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/remote/messages.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/remote/messages.py b/scripts/remote/messages.py index 76cccad393..de15e72ed5 100644 --- a/scripts/remote/messages.py +++ b/scripts/remote/messages.py @@ -35,12 +35,13 @@ class BBType(object): class BBPacket(object): - def __init__(self, p_type=0, p_flags=0, payload="", raw=None): + def __init__(self, p_type=0, p_flags=0, payload=b"", raw=None): self.p_type = p_type self.p_flags = p_flags if raw is not None: self.unpack(raw) else: + assert isinstance(payload, bytes) self.payload = payload def __repr__(self): |