1
0
Fork 0
mirror of synced 2024-11-14 21:18:58 -05:00
ultimate-vim/sources_non_forked/syntastic/syntax_checkers/python/compile.py

14 lines
287 B
Python
Raw Normal View History

2014-08-07 19:42:41 -04:00
#!/usr/bin/env python
from __future__ import print_function
from sys import argv, exit
if len(argv) != 2:
exit(1)
try:
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))