Skip to content

Commit 61f4198

Browse files
author
Filip Kubicz
committed
Fix SDO communication error printout
Before this change, raising an exception would fail with TypeError: not enough arguments for format string
1 parent 264ff4f commit 61f4198

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

canopen/sdo/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ def write(self, b):
406406
res_command, = struct.unpack("B", response[0:1])
407407
if res_command & 0xE0 != RESPONSE_SEGMENT_DOWNLOAD:
408408
raise SdoCommunicationError(
409-
"Unexpected response 0x%02X (expected 0x%02X)" % res_command)
409+
"Unexpected response 0x%02X (expected 0x%02X)" %
410+
(res_command, RESPONSE_SEGMENT_DOWNLOAD))
410411
# Advance position
411412
self.pos += bytes_sent
412413
return bytes_sent

0 commit comments

Comments
 (0)