6
6
import datetime
7
7
import decimal
8
8
import json
9
- from json .encoder import (FLOAT_REPR , INFINITY , c_make_encoder ,
10
- encode_basestring_ascii , encode_basestring ,
11
- _make_iterencode )
12
9
import uuid
10
+ from json .encoder import (FLOAT_REPR , INFINITY , _make_iterencode ,
11
+ c_make_encoder , encode_basestring ,
12
+ encode_basestring_ascii )
13
13
14
14
from django .db .models .query import QuerySet
15
15
from django .utils import six , timezone
@@ -55,7 +55,7 @@ def _encoder(o, _orig_encoder=_encoder, _encoding=self.encoding):
55
55
return _orig_encoder (o )
56
56
57
57
def floatstr (o , allow_nan = self .allow_nan ,
58
- _repr = FLOAT_REPR , _inf = INFINITY , _neginf = - INFINITY ):
58
+ _repr = FLOAT_REPR , _inf = INFINITY , _neginf = - INFINITY ):
59
59
# Check for specials. Note that this type of test is processor
60
60
# and/or platform-specific, so do tests which don't depend on the
61
61
# internals.
@@ -76,7 +76,6 @@ def floatstr(o, allow_nan=self.allow_nan,
76
76
77
77
return text
78
78
79
-
80
79
if (_one_shot and c_make_encoder is not None
81
80
and self .indent is None ):
82
81
_iterencode = c_make_encoder (
@@ -124,7 +123,7 @@ def default(self, obj):
124
123
elif hasattr (obj , 'tolist' ):
125
124
# Numpy arrays and array scalars.
126
125
return obj .tolist ()
127
- elif (coreapi is not None ) and isinstance (obj , (coreapi .Document ,
126
+ elif (coreapi is not None ) and isinstance (obj , (coreapi .Document ,
128
127
coreapi .Error )):
129
128
raise RuntimeError (
130
129
'Cannot return a coreapi object from a JSON view. '
0 commit comments