mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-31 18:46:53 +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:
|
||||
text = "NaN"
|
||||
text = 'NaN'
|
||||
elif o == _inf:
|
||||
text = "Infinity"
|
||||
text = 'Infinity'
|
||||
elif o == _neginf:
|
||||
text = "-Infinity"
|
||||
text = '-Infinity'
|
||||
else:
|
||||
return _repr(o)
|
||||
|
||||
if not allow_nan:
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue