Skip to content

Commit 0129a65

Browse files
committed
m1n1.utils: Tweak chexundump
Signed-off-by: Martin Povišer <povik@cutebit.org>
1 parent 1f8f966 commit 0129a65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

proxyclient/m1n1/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def chexundump(dump, base=0):
109109

110110
decoded = bytearray()
111111
for line in dump.splitlines():
112+
line = line.strip()
112113
if not line:
113114
continue
114115
try:
@@ -125,7 +126,7 @@ def chexundump(dump, base=0):
125126
decoded.extend([int(data[i:i+2], 16) for i \
126127
in range(0, len(data), 2)])
127128
except (ValueError, TypeError) as exc:
128-
raise ValueError(f"can't decode line: {line:r}") from exc
129+
raise ValueError(f"can't decode line: {repr(line)}") from exc
129130

130131
return decoded
131132

0 commit comments

Comments
 (0)