errprint("%r: Token Error: %s" % (file, msg))
return
+ except IndentationError, msg:
+ errprint("%r: Indentation Error: %s" % (file, msg))
+ return
+
except NannyNag, nag:
badline = nag.get_lineno()
line = nag.get_line()
def func88():
# comment
return 90
+
+# line 92
+def f():
+ class X:
+ def g():
+ "doc"
+ return 42
+ return X
+method_in_dynamic_class = f().g.im_func
def test_with_comment_instead_of_docstring(self):
self.assertSourceEqual(mod2.func88, 88, 90)
+ def test_method_in_dynamic_class(self):
+ self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97)
+
# Helper for testing classify_class_attrs.
def attrs_wo_objs(cls):
return [t[:3] for t in inspect.classify_class_attrs(cls)]
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)