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
fn = sys.argv[1]
print("Testing %s" % (fn,))
fp = open(fn, "rb")
try:
source = fp.read()
finally:
fp.close()
compile(source, fn, "exec")
def main(fn):
print("Testing %s" % (fn,))
fp = open(fn, "rb")
try:
source = fp.read()
finally:
fp.close()
compile(source, fn, "exec")
if __name__ == "__main__":
main(sys.argv[1])