Skip to content

Commit

Permalink
fallback to django's included simplejson if the user doesn't have it …
Browse files Browse the repository at this point in the history
…installed
  • Loading branch information
alex committed Nov 19, 2008
1 parent f441970 commit 508a346
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ajax_validation/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django.utils.functional import Promise
from django.utils.encoding import force_unicode
from simplejson import JSONEncoder
try:
from simplejson import JSONEncoder
except ImportError:
from django.utils.simplejson import JSONEncoder

class LazyEncoder(JSONEncoder):
def default(self, obj):
Expand Down

1 comment on commit 508a346

@ericflo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably fall back to the json standard module library from 2.6 before Django’s built-in version, as the stdlib version will have the C speedups that Django’s won’t.

Please sign in to comment.