aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-01-03 08:44:15 +0200
committerEzio Melotti <ezio.melotti@gmail.com>2013-01-03 08:44:15 +0200
commit37623ab5f12b9034b1935f9507c3a5d1786dfd9e (patch)
tree729a3010f82d3017a0220edc08cfdaf13d44503e /Lib/json/scanner.py
parent(Merge 3.3) Issue #16367: Fix FileIO.readall() on Windows for files larger th... (diff)
downloadcpython-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.py4
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: