From 37623ab5f12b9034b1935f9507c3a5d1786dfd9e Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Thu, 3 Jan 2013 08:44:15 +0200 Subject: #16009: JSON error messages now provide more information. Patch by Serhiy Storchaka. --- Lib/json/scanner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/json/scanner.py') 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: -- cgit v1.2.3