Make tabnanny recognize IndentationErrors raised by tokenize.
Add a test to test_inspect to make sure indented source
is recognized correctly. (fixes #1224621)
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index a30791c..a9be4cf 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -273,7 +273,8 @@
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)