summaryrefslogtreecommitdiffstats
path: root/Lib/json/decoder.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/json/decoder.py')
-rw-r--r--Lib/json/decoder.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/Lib/json/decoder.py b/Lib/json/decoder.py
index acaee25..e80b935 100644
--- a/Lib/json/decoder.py
+++ b/Lib/json/decoder.py
@@ -14,17 +14,7 @@ __all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
-
-def _floatconstants():
- import struct
- import sys
- _BYTES = '7FF80000000000007FF0000000000000'.decode('hex')
- if sys.byteorder != 'big':
- _BYTES = _BYTES[:8][::-1] + _BYTES[8:][::-1]
- nan, inf = struct.unpack('dd', _BYTES)
- return nan, inf, -inf
-
-NaN, PosInf, NegInf = _floatconstants()
+NaN, PosInf, NegInf = float('nan'), float('inf'), float('-inf')
def linecol(doc, pos):