diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-03-12 11:15:15 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-03-12 11:15:15 +0200 |
commit | aef79164ae10e13c882ce2e10905809d16b85b09 (patch) | |
tree | 3ade3038667a84bfc33976d288b2edd951246b25 /Lib/test/test_json/__init__.py | |
parent | f52cb397c583d106875f30d61ed323e50f18a389 (diff) | |
parent | 3d12c5b8e36f281af3dda150def4e1eb7a3b3269 (diff) | |
download | cpython-aef79164ae10e13c882ce2e10905809d16b85b09.tar.gz |
Issue #22928: Disabled HTTP header injections in http.client.
Original patch by Demian Brecht.
Diffstat (limited to 'Lib/test/test_json/__init__.py')
-rw-r--r-- | Lib/test/test_json/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_json/__init__.py b/Lib/test/test_json/__init__.py index 2cf1032f35..0807e6fb4f 100644 --- a/Lib/test/test_json/__init__.py +++ b/Lib/test/test_json/__init__.py @@ -9,12 +9,15 @@ from test import support # import json with and without accelerations cjson = support.import_fresh_module('json', fresh=['_json']) pyjson = support.import_fresh_module('json', blocked=['_json']) +# JSONDecodeError is cached inside the _json module +cjson.JSONDecodeError = cjson.decoder.JSONDecodeError = json.JSONDecodeError # create two base classes that will be used by the other tests class PyTest(unittest.TestCase): json = pyjson loads = staticmethod(pyjson.loads) dumps = staticmethod(pyjson.dumps) + JSONDecodeError = staticmethod(pyjson.JSONDecodeError) @unittest.skipUnless(cjson, 'requires _json') class CTest(unittest.TestCase): @@ -22,6 +25,7 @@ class CTest(unittest.TestCase): json = cjson loads = staticmethod(cjson.loads) dumps = staticmethod(cjson.dumps) + JSONDecodeError = staticmethod(cjson.JSONDecodeError) # test PyTest and CTest checking if the functions come from the right module class TestPyTest(PyTest): |