Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated robot utils usage #462

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/SSHLibrary/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from .config import (Configuration, IntegerEntry, NewlineEntry, StringEntry,
TimeEntry)
from robot.api import logger
from robot.utils import is_bytes, is_string, is_unicode, is_truthy, unicode, is_list_like
from robot.utils import is_bytes, is_string, is_truthy, is_list_like
from .pythonforward import LocalPortForwarding

try:
Expand Down Expand Up @@ -234,7 +234,7 @@ def _encode(self, text):
if is_bytes(text):
return text
if not is_string(text):
text = unicode(text)
text = str(text)
return text.encode(self.config.encoding, self.config.encoding_errors)

def _decode(self, bytes):
Expand Down Expand Up @@ -1459,7 +1459,7 @@ def _isabs(path):
return destination.rsplit(path_separator, 1)

def _create_missing_remote_path(self, path, mode):
if is_unicode(path):
if is_string(path):
path = path.encode(self._encoding)
if path.startswith(b'/'):
current_dir = b'/'
Expand Down