Skip to content

Commit 3f5c142

Browse files
committed
Return strings instead of null
1 parent 8383e40 commit 3f5c142

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rest_framework/utils/encoders.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ def floatstr(o, allow_nan=self.allow_nan,
5959
# internals.
6060

6161
if o != o:
62-
text = 'null'
62+
text = '"NaN"'
6363
elif o == _inf:
64-
text = 'null'
64+
text = '"Infinity"'
6565
elif o == _neginf:
66-
text = 'null'
66+
text = '"-Infinity"'
6767
else:
6868
return _repr(o)
6969

0 commit comments

Comments
 (0)