bpo-30877: Fix clearing a cache in the the JSON decoder. (GH-7048)

This commit is contained in:
Serhiy Storchaka 2018-05-22 14:55:07 +03:00 committed by GitHub
parent 55bfe690d5
commit ae00fb1d4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View file

@ -58,7 +58,9 @@ class TestDecode:
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'