Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 898d51d

Browse files
committed
#14875: Use float('inf') instead of float('1e66666') in the json module.
1 parent dfa4652 commit 898d51d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/json/encoder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
ESCAPE_DCT.setdefault(chr(i), '\\u{0:04x}'.format(i))
2828
#ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,))
2929

30-
# Assume this produces an infinity on all machines (probably not guaranteed)
31-
INFINITY = float('1e66666')
30+
INFINITY = float('inf')
3231
FLOAT_REPR = repr
3332

3433
def encode_basestring(s):

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Core and Builtins
6767
Library
6868
-------
6969

70+
- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
71+
7072
- Issue #14426: Correct the Date format in Expires attribute of Set-Cookie
7173
Header in Cookie.py.
7274

0 commit comments

Comments
 (0)