From 23507e6124041ed17f39db211e802495e37520e7 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Fri, 11 Sep 2015 13:43:28 +0200 Subject: Alias "unicode" to "str" under Python 3 The six way of doing this is to replace all occurences of "unicode" with "six.text_type". However, "unicode" is non-ambiguous and (arguably) easier to read. Also, using it makes the patches smaller, which should help with backporting. Reviewed-By: Petr Viktorin --- ipapython/ssh.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ipapython/ssh.py') diff --git a/ipapython/ssh.py b/ipapython/ssh.py index c95488928..c8d8306f2 100644 --- a/ipapython/ssh.py +++ b/ipapython/ssh.py @@ -28,6 +28,11 @@ import struct from hashlib import md5, sha1 from hashlib import sha256 #pylint: disable=E0611 +import six + +if six.PY3: + unicode = str + __all__ = ['SSHPublicKey'] OPENSSH_BASE_REGEX = re.compile(r'^[\t ]*(?P[^\x00\n\r]+?) [\t ]*(?P[^\x00\n\r]+?)(?:[\t ]+(?P[^\x00\n\r]*?)[\t ]*)?$') -- cgit