pytest2/py/_testing/check_compile.py

11 lines
157 B
Python

import sys
fn = sys.argv[1]
print("Testing %s" % (fn,))
fp = open(fn, "rb")
try:
source = fp.read()
finally:
fp.close()
compile(source, fn, "exec")