Skip to content

Commit e020393

Browse files
rqx110dpranke
authored andcommitted
fix json dump error on python 2
1 parent e28f7b9 commit e020393

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

json5/lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ def _dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, indent,
264264
s = u'false'
265265
elif obj is None:
266266
s = u'null'
267-
elif obj == math.inf:
267+
elif obj == float('inf'):
268268
if allow_nan:
269269
s = u'Infinity'
270270
else:
271271
raise ValueError()
272-
elif obj == -math.inf:
272+
elif obj == float('-inf'):
273273
if allow_nan:
274274
s = u'-Infinity'
275275
else:

0 commit comments

Comments
 (0)