MCPcopy Index your code
hub / github.com/python/cpython / tabnanny

Method tabnanny

Lib/idlelib/runscript.py:61–77  ·  view source on GitHub ↗
(self, filename)

Source from the content-addressed store, hash-verified

59 return "break"
60
61 def tabnanny(self, filename):
62 # XXX: tabnanny should work on binary files as well
63 with tokenize.open(filename) as f:
64 try:
65 tabnanny.process_tokens(tokenize.generate_tokens(f.readline))
66 except tokenize.TokenError as msg:
67 msgtxt, (lineno, start) = msg.args
68 self.editwin.gotoline(lineno)
69 self.errorbox("Tabnanny Tokenizing Error",
70 "Token Error: %s" % msgtxt)
71 return False
72 except tabnanny.NannyNag as nag:
73 # The error messages from tabnanny are too confusing...
74 self.editwin.gotoline(nag.get_lineno())
75 self.errorbox("Tab/space error", indent_message)
76 return False
77 return True
78
79 def checksyntax(self, filename):
80 self.shell = shell = self.flist.open_shell()

Callers 2

check_module_eventMethod · 0.95
run_module_eventMethod · 0.95

Calls 4

errorboxMethod · 0.95
gotolineMethod · 0.80
openMethod · 0.45
get_linenoMethod · 0.45

Tested by

no test coverage detected