From: Georg Brandl Date: Fri, 13 May 2011 04:54:23 +0000 (+0200) Subject: Fix unbound local error in RE tokenizer example. Thanks to Herman L. Jackson. X-Git-Tag: v3.2.1rc1~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=325477e20eb6c2b813d06312d9b270706e186ec9;p=thirdparty%2FPython%2Fcpython.git Fix unbound local error in RE tokenizer example. Thanks to Herman L. Jackson. --- diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 3e9cf026f07d..cd3fbb6be0e4 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1322,9 +1322,10 @@ successive matches:: line_start = pos line += 1 elif typ != 'SKIP': + val = mo.group(typ) if typ == 'ID' and val in keywords: typ = val - yield Token(typ, mo.group(typ), line, mo.start()-line_start) + yield Token(typ, val, line, mo.start()-line_start) pos = mo.end() mo = gettok(s, pos) if pos != len(s):