summaryrefslogtreecommitdiff
path: root/Lib/tokenize.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-08-14 21:34:08 +0000
committerGeorg Brandl <georg@python.org>2006-08-14 21:34:08 +0000
commit2463f8f831bdf7ed562a26a13a6214f203f0b037 (patch)
treed0cb99f5c7ce3624a210f436117b8cfa7eb63445 /Lib/tokenize.py
parent26a07b5198e47d7874eef14e15dee2cc0e644cb9 (diff)
downloadcpython-git-2463f8f831bdf7ed562a26a13a6214f203f0b037.tar.gz
Make tabnanny recognize IndentationErrors raised by tokenize.
Add a test to test_inspect to make sure indented source is recognized correctly. (fixes #1224621)
Diffstat (limited to 'Lib/tokenize.py')
-rw-r--r--Lib/tokenize.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index a30791c2cd..a9be4cfe03 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -273,7 +273,8 @@ def generate_tokens(readline):
while column < indents[-1]:
if column not in indents:
raise IndentationError(
- "unindent does not match any outer indentation level")
+ "unindent does not match any outer indentation level",
+ ("<tokenize>", lnum, pos, line))
indents = indents[:-1]
yield (DEDENT, '', (lnum, pos), (lnum, pos), line)