Skip to content

Commit 9c9db3a

Browse files
committed
tools, pyboard.py: Allow exec argument to be bytes or str.
1 parent 1a55b6a commit 9c9db3a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools/pyboard.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ def eval(self, expression):
7171
return ret
7272

7373
def exec(self, command):
74-
command_bytes = bytes(command, encoding='ascii')
74+
if isinstance(command, bytes):
75+
command_bytes = command
76+
else:
77+
command_bytes = bytes(command, encoding='ascii')
7578
for i in range(0, len(command_bytes), 32):
7679
self.serial.write(command_bytes[i:min(i+32, len(command_bytes))])
7780
time.sleep(0.01)

0 commit comments

Comments
 (0)