diff options
author | Raymond Hettinger <python@rcn.com> | 2005-06-21 07:43:58 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-06-21 07:43:58 (GMT) |
commit | da99d1cbfeedafd41263ac2d1b397d57c14ab28e (patch) | |
tree | 998e22dfe11672ffa2d7c6ee69b4af1e59914349 /Lib/tokenize.py | |
parent | 8fa7eb563bb9a14651bcdc8ee60c5e45302c2f59 (diff) | |
download | cpython-da99d1cbfeedafd41263ac2d1b397d57c14ab28e.zip cpython-da99d1cbfeedafd41263ac2d1b397d57c14ab28e.tar.gz cpython-da99d1cbfeedafd41263ac2d1b397d57c14ab28e.tar.bz2 |
SF bug #1224621: tokenize module does not detect inconsistent dedents
Diffstat (limited to 'Lib/tokenize.py')
-rw-r--r-- | Lib/tokenize.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/tokenize.py b/Lib/tokenize.py index b29da6b..2b40e6f 100644 --- a/Lib/tokenize.py +++ b/Lib/tokenize.py @@ -271,6 +271,9 @@ def generate_tokens(readline): indents.append(column) yield (INDENT, line[:pos], (lnum, 0), (lnum, pos), line) while column < indents[-1]: + if column not in indents: + raise IndentationError( + "unindent does not match any outer indentation level") indents = indents[:-1] yield (DEDENT, '', (lnum, pos), (lnum, pos), line) |