diff --git a/django/core/serializers/json.py b/django/core/serializers/json.py index c2407d2a71..7b570f36d8 100644 --- a/django/core/serializers/json.py +++ b/django/core/serializers/json.py @@ -18,7 +18,9 @@ class Serializer(PythonSerializer): internal_use_only = False def end_serialization(self): - self.options.update({'use_decimal': False}) # Use JS strings to represent Python Decimal instances (ticket #16850) + if simplejson.__version__.split('.') >= ['2', '1', '3']: + # Use JS strings to represent Python Decimal instances (ticket #16850) + self.options.update({'use_decimal': False}) simplejson.dump(self.objects, self.stream, cls=DjangoJSONEncoder, **self.options) def getvalue(self):