From 9a0a928cf532314ce7a6766def946db4c2d7d0d1 Mon Sep 17 00:00:00 2001 From: linsoft Date: Sun, 4 Mar 2018 23:01:36 +0800 Subject: [PATCH] Fixed TypeError in TcpHandle and sign_pythonrsa --- CONTRIBUTORS | 2 +- adb/adb_commands.py | 2 +- adb/common.py | 4 ++-- adb/sign_pythonrsa.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index ddb520b..f3fd05b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -7,4 +7,4 @@ Max Borghino Mohammad Abu-Garbeyyeh Josip Delic Greg E. - +Yongguang Lin diff --git a/adb/adb_commands.py b/adb/adb_commands.py index c9ca631..13c5564 100644 --- a/adb/adb_commands.py +++ b/adb/adb_commands.py @@ -128,7 +128,7 @@ def ConnectDevice(self, port_path=None, serial=None, default_timeout_ms=None, ** # If there isnt a handle override (used by tests), build one here if 'handle' in kwargs: self._handle = kwargs.pop('handle') - elif serial and b':' in serial: + elif serial and ':' in serial: self._handle = common.TcpHandle(serial, timeout_ms=default_timeout_ms) else: self._handle = common.UsbHandle.FindAndOpen( diff --git a/adb/common.py b/adb/common.py index 2c95f8e..c81e842 100644 --- a/adb/common.py +++ b/adb/common.py @@ -295,8 +295,8 @@ def __init__(self, serial, timeout_ms=None): Host may be an IP address or a host name. """ - if b':' in serial: - (host, port) = serial.split(b':') + if ':' in serial: + (host, port) = serial.split(':') else: host = serial port = 5555 diff --git a/adb/sign_pythonrsa.py b/adb/sign_pythonrsa.py index 5c00bb2..fcf0725 100644 --- a/adb/sign_pythonrsa.py +++ b/adb/sign_pythonrsa.py @@ -24,7 +24,7 @@ # hashing algo for this. class _Accum(object): def __init__(self): - self._buf = '' + self._buf = b'' def update(self, msg): self._buf += msg def digest(self):