diff options
Diffstat (limited to 'extra/tigertool/ecusb/tiny_servo_common.py')
-rw-r--r-- | extra/tigertool/ecusb/tiny_servo_common.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/extra/tigertool/ecusb/tiny_servo_common.py b/extra/tigertool/ecusb/tiny_servo_common.py index 185f2a67d1..0e650a2d1d 100644 --- a/extra/tigertool/ecusb/tiny_servo_common.py +++ b/extra/tigertool/ecusb/tiny_servo_common.py @@ -12,8 +12,8 @@ import subprocess import sys import time -import pty_driver -import stm32uart +from . import pty_driver +from . import stm32uart class TinyServoError(Exception): @@ -40,7 +40,8 @@ def check_usb(vidpid, serialname=None): Returns: True if found, False, otherwise. """ if serialname: - output = subprocess.check_output(['lsusb', '-v', '-d', vidpid]) + output = subprocess.check_output(['lsusb', '-v', '-d', vidpid], + encoding='utf-8') m = re.search(r'^\s*iSerial\s+\d+\s+%s$' % serialname, output, flags=re.M) if m: return True @@ -63,7 +64,8 @@ def check_usb_sn(vidpid): Returns: string serial number if found, None otherwise. """ - output = subprocess.check_output(['lsusb', '-v', '-d', vidpid]) + output = subprocess.check_output(['lsusb', '-v', '-d', vidpid], + encoding='utf-8') m = re.search(r'^\s*iSerial\s+(.*)$', output, flags=re.M) if m: return m.group(1) |