diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-05-08 10:36:57 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-05-08 10:36:57 -0400 |
commit | e7808e11de87127451f25e5cd45f8f764cbcb590 (patch) | |
tree | 70b55392fad5a0e51d720fe3572a7e6b8cea01ea | |
parent | 1f262db4040328572565bfdac4b435fd19afaae1 (diff) |
Add builtins to compatibility imports
-rw-r--r-- | paramiko/py3compat.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/paramiko/py3compat.py b/paramiko/py3compat.py index 57c096b2..6fafc31d 100644 --- a/paramiko/py3compat.py +++ b/paramiko/py3compat.py @@ -3,7 +3,7 @@ import base64 __all__ = ['PY2', 'string_types', 'integer_types', 'text_type', 'bytes_types', 'bytes', 'long', 'input', 'decodebytes', 'encodebytes', 'bytestring', 'byte_ord', 'byte_chr', 'byte_mask', - 'b', 'u', 'b2s', 'StringIO', 'BytesIO', 'is_callable', 'MAXSIZE', 'next'] + 'b', 'u', 'b2s', 'StringIO', 'BytesIO', 'is_callable', 'MAXSIZE', 'next', 'builtins'] PY2 = sys.version_info[0] < 3 @@ -18,6 +18,8 @@ if PY2: decodebytes = base64.decodestring encodebytes = base64.encodestring + import __builtin__ as builtins + def bytestring(s): # NOQA if isinstance(s, unicode): @@ -102,6 +104,7 @@ if PY2: else: import collections import struct + import builtins string_types = str text_type = str bytes = bytes |