diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-01-03 08:44:15 +0200 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-01-03 08:44:15 +0200 |
commit | 37623ab5f12b9034b1935f9507c3a5d1786dfd9e (patch) | |
tree | 729a3010f82d3017a0220edc08cfdaf13d44503e /Lib/json/scanner.py | |
parent | (Merge 3.3) Issue #16367: Fix FileIO.readall() on Windows for files larger th... (diff) | |
download | cpython-37623ab5f12b9034b1935f9507c3a5d1786dfd9e.tar.gz cpython-37623ab5f12b9034b1935f9507c3a5d1786dfd9e.tar.bz2 cpython-37623ab5f12b9034b1935f9507c3a5d1786dfd9e.zip |
#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 23eef61b94b..86426cde1a7 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: |