diff options
author | Roy Williams <rwilliams@lyft.com> | 2016-09-22 11:03:28 -0700 |
---|---|---|
committer | Roy Williams <rwilliams@lyft.com> | 2016-09-22 11:03:30 -0700 |
commit | a1cd6421d095af6c7db5e5c44e14916eb555aade (patch) | |
tree | dd3fe33ab902749418a6489685ca4a7710622cc9 | |
parent | bb1d5c819ec06a3c085fe265f9b6f92752127a28 (diff) | |
download | simplejson-a1cd6421d095af6c7db5e5c44e14916eb555aade.tar.gz |
Add support for Python 2.5
-rw-r--r-- | simplejson/compat.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/simplejson/compat.py b/simplejson/compat.py index 270b469..6dd4132 100644 --- a/simplejson/compat.py +++ b/simplejson/compat.py @@ -15,8 +15,12 @@ if sys.version_info[0] < 3: integer_types = (int, long) unichr = unichr reload_module = reload - import binascii - fromhex = binascii.unhexlify + try: + from binascii import unhexlify as fromhex + except ImportError: + # Python 2.5 + def fromhex(s): + return s.decode('hex') else: PY3 = True |