Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Fix string handling for TCP Handler (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
sytone authored and fahhem committed Aug 11, 2017
1 parent bed1a53 commit cb4ae46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion adb/adb_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def Connect(cls, usb, banner=None, **kwargs):
An instance of this class if the device connected successfully.
"""
if not banner:
banner = socket.gethostname()
banner = socket.gethostname().encode()
device_state = cls.protocol_handler.Connect(usb, banner=banner, **kwargs)
# Remove banner and colons after device state (state::banner)
device_state = device_state.split(b':')[0]
Expand Down
4 changes: 2 additions & 2 deletions adb/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ def __init__(self, serial):
Host may be an IP address or a host name.
"""
if ':' in serial:
(host, port) = serial.split(':')
if b':' in serial:
(host, port) = serial.split(b':')
else:
host = serial
port = 5555
Expand Down

0 comments on commit cb4ae46

Please sign in to comment.