Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/json/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ def scan_once(string, idx):
finally:
memo.clear()

return _scan_once
return scan_once

make_scanner = c_make_scanner or py_make_scanner
4 changes: 3 additions & 1 deletion Lib/test/test_json/test_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def check_keys_reuse(self, source, loads):
def test_keys_reuse(self):
s = '[{"a_key": 1, "b_\xe9": 2}, {"a_key": 3, "b_\xe9": 4}]'
self.check_keys_reuse(s, self.loads)
self.check_keys_reuse(s, self.json.decoder.JSONDecoder().decode)
decoder = self.json.decoder.JSONDecoder()
self.check_keys_reuse(s, decoder.decode)
self.assertFalse(decoder.memo)

def test_extra_data(self):
s = '[1, 2, 3]5'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed a bug in the Python implementation of the JSON decoder that prevented
the cache of parsed strings from clearing after finishing the decoding.
Based on patch by c-fos.