diff options
| author | Tim Graham <timograham@gmail.com> | 2017-06-20 15:16:37 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-09-25 17:11:06 -0400 |
| commit | 98706bb35e7de0e445cc336f669919047bf46b75 (patch) | |
| tree | 976c38c9985dbd9d01c8a65244cde122e5ee0409 /django/test | |
| parent | cfff2af02be40106d4759cc6f8bfa476ce82421c (diff) | |
Refs #27857 -- Replaced json.loads() ValueError exception catching with JSONDecodeError.
Diffstat (limited to 'django/test')
| -rw-r--r-- | django/test/testcases.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py index ff17639d51..afab58f2dc 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -708,7 +708,7 @@ class SimpleTestCase(unittest.TestCase): """ try: data = json.loads(raw) - except ValueError: + except json.JSONDecodeError: self.fail("First argument is not valid JSON: %r" % raw) if isinstance(expected_data, str): try: @@ -725,12 +725,12 @@ class SimpleTestCase(unittest.TestCase): """ try: data = json.loads(raw) - except ValueError: + except json.JSONDecodeError: self.fail("First argument is not valid JSON: %r" % raw) if isinstance(expected_data, str): try: expected_data = json.loads(expected_data) - except ValueError: + except json.JSONDecodeError: self.fail("Second argument is not valid JSON: %r" % expected_data) self.assertNotEqual(data, expected_data, msg=msg) |
