diff Lib/json/decoder.py @ 48769:83b2d07b475b

#2834: Change re module semantics, so that str and bytes mixing is forbidden, and str (unicode) patterns get full unicode matching by default. The re.ASCII flag is also introduced to ask for ASCII matching instead.
author Antoine Pitrou <solipsis@pitrou.net>
date Tue, 19 Aug 2008 17:56:33 +0000
parents 9f45979558a9
children 00e467db6182
line wrap: on
line diff
--- a/Lib/json/decoder.py	Tue Aug 19 17:16:56 2008 +0000
+++ b/Lib/json/decoder.py	Tue Aug 19 17:56:33 2008 +0000
@@ -67,7 +67,7 @@
         fn = getattr(context, 'parse_int', None) or int
         res = fn(integer)
     return res, None
-pattern(r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?')(JSONNumber)
+pattern(r'(-?(?:0|[1-9][0-9]*))(\.[0-9]+)?([eE][-+]?[0-9]+)?')(JSONNumber)
 
 
 STRINGCHUNK = re.compile(r'(.*?)(["\\\x00-\x1f])', FLAGS)