diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-01-03 06:44:15 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-01-03 06:44:15 (GMT) |
commit | 37623ab5f12b9034b1935f9507c3a5d1786dfd9e (patch) | |
tree | 729a3010f82d3017a0220edc08cfdaf13d44503e /Lib/json/scanner.py | |
parent | fd53a5a01150de79cfb1673e89711c6cd6258ea2 (diff) | |
download | cpython-37623ab5f12b9034b1935f9507c3a5d1786dfd9e.zip cpython-37623ab5f12b9034b1935f9507c3a5d1786dfd9e.tar.gz cpython-37623ab5f12b9034b1935f9507c3a5d1786dfd9e.tar.bz2 |
#16009: JSON error messages now provide more information. Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/json/scanner.py')
-rw-r--r-- | Lib/json/scanner.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/json/scanner.py b/Lib/json/scanner.py index 23eef61..86426cd 100644 --- a/Lib/json/scanner.py +++ b/Lib/json/scanner.py @@ -29,7 +29,7 @@ def py_make_scanner(context): try: nextchar = string[idx] except IndexError: - raise StopIteration + raise StopIteration(idx) if nextchar == '"': return parse_string(string, idx + 1, strict) @@ -60,7 +60,7 @@ def py_make_scanner(context): elif nextchar == '-' and string[idx:idx + 9] == '-Infinity': return parse_constant('-Infinity'), idx + 9 else: - raise StopIteration + raise StopIteration(idx) def scan_once(string, idx): try: |