This commit is contained in:
Matthew McPherrin 2012-04-08 03:41:26 -04:00
parent 433793afab
commit 274cc21040
1 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,8 @@
#!/usr/bin/env python
import urllib2, sys
pages=["https://csclub.uwaterloo.ca", "http://mirror.csclub.uwaterloo.ca"]
pages=["https://csclub.uwaterloo.ca",
"http://mirror.csclub.uwaterloo.ca"]
for page in pages:
try:
@ -13,9 +14,10 @@ for page in pages:
if not"Computer Science Club" in page:
print "FAIL, homepage doesn't mention Computer Science Club"
sys.exit(3)
# So read() didn't throw an exception, nor did opening,
# and we have enough data, so likely good.
sys.exit(0)
except urllib2.URLError as e:
print "FAIL, exception ", e
sys.exit(1)
# So read() didn't throw an exception, nor did opening,
# and we have enough data, so likely good.
sys.exit(0)