diff options
author | Rune Halvorsen <runefh@gmail.com> | 2009-06-20 12:16:50 +0200 |
---|---|---|
committer | Rune Halvorsen <runefh@gmail.com> | 2009-06-20 12:16:50 +0200 |
commit | 8c00c71de736c54c22fedfae86101eb99846ba4f (patch) | |
tree | 30003143d0e571e576ab3c6e9e06a86afeeb3cb7 | |
parent | a89ad1420af5179bad2d8d6f8b06cd620a41341d (diff) | |
download | anyjson-8c00c71de736c54c22fedfae86101eb99846ba4f.tar.gz |
Raise our own ImportError if all fails. Looks better than to complain about
django when that happens
-rw-r--r-- | anyjson.py | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -40,8 +40,12 @@ except ImportError: serialize = json.dumps deserialize = json.loads except ImportError: - # If all of the above fails, try to fallback to the simplejson - # embedded in Django. - from django.utils import simplejson - serialize = simplejson.dumps - deserialize = simplejson.loads + try: + # If all of the above fails, try to fallback to the simplejson + # embedded in Django. + from django.utils import simplejson + serialize = simplejson.dumps + deserialize = simplejson.loads + except: + raise ImportError("No json module found") + |