diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2013-09-29 17:48:14 -0400 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2013-09-29 17:48:14 -0400 |
| commit | ef7a80865f253852f7c7b01f04bc02b695ead67b (patch) | |
| tree | ea718f746b5f9db4624057d1f0aa1df9abee8bd4 /simplejson/compat.py | |
| parent | 19346fa9068878af516cdb670bea4f791337507b (diff) | |
| download | lastfm-ef7a80865f253852f7c7b01f04bc02b695ead67b.tar.gz | |
Giving up on Python 2.5 support
Diffstat (limited to 'simplejson/compat.py')
| -rw-r--r-- | simplejson/compat.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/simplejson/compat.py b/simplejson/compat.py deleted file mode 100644 index 449e48a..0000000 --- a/simplejson/compat.py +++ /dev/null @@ -1,43 +0,0 @@ -"""Python 3 compatibility shims -""" -import sys -if sys.version_info[0] < 3: - PY3 = False - def b(s): - return s - def u(s): - return unicode(s, 'unicode_escape') - import cStringIO as StringIO - StringIO = BytesIO = StringIO.StringIO - text_type = unicode - binary_type = str - string_types = (basestring,) - integer_types = (int, long) - unichr = unichr - reload_module = reload - def fromhex(s): - return s.decode('hex') - -else: - PY3 = True - from imp import reload as reload_module - import codecs - def b(s): - return codecs.latin_1_encode(s)[0] - def u(s): - return s - import io - StringIO = io.StringIO - BytesIO = io.BytesIO - text_type = str - binary_type = bytes - string_types = (str,) - integer_types = (int,) - - def unichr(s): - return u(chr(s)) - - def fromhex(s): - return bytes.fromhex(s) - -long_type = integer_types[-1] |
