Python: code being checked shouldn't inherit future statements.

This commit is contained in:
LCD 47 2014-01-06 17:04:55 +02:00
parent c82a9a92e9
commit dfe1e025ee

View File

@ -8,6 +8,6 @@ if len(argv) != 2:
exit(1)
try:
compile(open(argv[1]).read(), argv[1], 'exec')
compile(open(argv[1]).read(), argv[1], 'exec', 0, 1)
except SyntaxError as err:
print('%s:%s:%s: %s' % (err.filename, err.lineno, err.offset, err.msg))