mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-10 13:24:18 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
6d80bf563e
commit
20792c1e1f
1 changed files with 4 additions and 4 deletions
|
|
@ -42,17 +42,17 @@ class FloatPreservingEncoder(json.JSONEncoder):
|
||||||
):
|
):
|
||||||
|
|
||||||
if o != o:
|
if o != o:
|
||||||
text = "NaN"
|
text = 'NaN'
|
||||||
elif o == _inf:
|
elif o == _inf:
|
||||||
text = "Infinity"
|
text = 'Infinity'
|
||||||
elif o == _neginf:
|
elif o == _neginf:
|
||||||
text = "-Infinity"
|
text = '-Infinity'
|
||||||
else:
|
else:
|
||||||
return _repr(o)
|
return _repr(o)
|
||||||
|
|
||||||
if not allow_nan:
|
if not allow_nan:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Out of range float values are not JSON compliant: " + repr(o)
|
'Out of range float values are not JSON compliant: ' + repr(o),
|
||||||
)
|
)
|
||||||
|
|
||||||
return text
|
return text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue