mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
#17368: Fix an off-by-one error in the Python JSON decoder that caused a failure while decoding empty object literals when object_pairs_hook was specified.
This commit is contained in:
parent
7343cb0790
commit
a7d64a6f4c
3 changed files with 15 additions and 5 deletions
|
@ -167,7 +167,7 @@ def JSONObject(s_and_end, strict, scan_once, object_hook, object_pairs_hook,
|
|||
if nextchar == '}':
|
||||
if object_pairs_hook is not None:
|
||||
result = object_pairs_hook(pairs)
|
||||
return result, end
|
||||
return result, end + 1
|
||||
pairs = {}
|
||||
if object_hook is not None:
|
||||
pairs = object_hook(pairs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue