guard against tests trying to import this

--HG--
branch : trunk
This commit is contained in:
Benjamin Peterson 2009-08-29 14:50:44 -05:00
parent 9018fe40e3
commit 8a6a3183ae
1 changed files with 11 additions and 8 deletions

View File

@ -1,10 +1,13 @@
import sys import sys
fn = sys.argv[1] def main(fn):
print("Testing %s" % (fn,)) print("Testing %s" % (fn,))
fp = open(fn, "rb") fp = open(fn, "rb")
try: try:
source = fp.read() source = fp.read()
finally: finally:
fp.close() fp.close()
compile(source, fn, "exec") compile(source, fn, "exec")
if __name__ == "__main__":
main(sys.argv[1])