diff --git a/monkey.py b/monkey.py index d8f1215..125b116 100644 --- a/monkey.py +++ b/monkey.py @@ -1,6 +1,13 @@ # custom json encoding -from simplejson import JSONEncoder +# make sure we use the json encoder that bottle uses +try: + from simplejson import JSONEncoder +except ImportError: + try: + from json import JSONEncoder + except ImportError: + from django.utils.simplejson import JSONEncoder def newdefault(self,object): return getattr(object.__class__,"__json__", olddefault)(object)