Kaydet (Commit) 75ee8f54 authored tarafından Barry Warsaw's avatar Barry Warsaw

main(): Slightly more informative error message when TokenError

occurs.  Also, continue processing.
üst 68d486c8
......@@ -464,7 +464,11 @@ def main():
closep = 1
try:
eater.set_filename(filename)
tokenize.tokenize(fp.readline, eater)
try:
tokenize.tokenize(fp.readline, eater)
except tokenize.TokenError, e:
sys.stderr.write('%s: %s, line %d, column %d\n' %
(e[0], filename, e[1][0], e[1][1]))
finally:
if closep:
fp.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment