diff options
author | Damien George <damien.p.george@gmail.com> | 2014-10-19 14:54:52 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-10-19 14:54:52 +0100 |
commit | 9c9db3a7a1c21e575f32c964d7e6260a5a158cdb (patch) | |
tree | 2d5a0c2f0917834ca1910c82f39c8c79180f62e6 /tools/pyboard.py | |
parent | 1a55b6a787ee7a568550ac0510632965af61c9ee (diff) |
tools, pyboard.py: Allow exec argument to be bytes or str.
Diffstat (limited to 'tools/pyboard.py')
-rw-r--r-- | tools/pyboard.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py index f7bd92b26..40f2ac934 100644 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -71,7 +71,10 @@ class Pyboard: return ret def exec(self, command): - command_bytes = bytes(command, encoding='ascii') + if isinstance(command, bytes): + command_bytes = command + else: + command_bytes = bytes(command, encoding='ascii') for i in range(0, len(command_bytes), 32): self.serial.write(command_bytes[i:min(i+32, len(command_bytes))]) time.sleep(0.01) |