From 7db31ad40528421524519a513c9b8ce8728635fb Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 15 Feb 2001 05:15:06 +0000 Subject: Error handling improved. svn path=/trunk/; revision=3101 --- torturetest.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'torturetest.py') diff --git a/torturetest.py b/torturetest.py index c65b2e27..a75f6ac0 100755 --- a/torturetest.py +++ b/torturetest.py @@ -30,8 +30,8 @@ class TestSite: "Userid: %s\n" \ "Password: %s\n" \ "Protocol: %s\n" \ - "Options: '%s'\n" \ - "Capabilities: '%s'\n" \ + "Options: %s\n" \ + "Capabilities: %s\n" \ "Version: %s\n" \ "Comment: %s\n" \ % self.allattrs() @@ -91,14 +91,20 @@ if __name__ == "__main__": # Start by reading in the sitelist ifp = open("testsites") sitelist = [] + linect = 0 while 1: + linect += 1 line = ifp.readline() if not line: break elif line[0] in ("#", "\n"): continue else: - sitelist.append(TestSite(line)) + try: + sitelist.append(TestSite(line)) + except: + print "Error on line %d" % linect + sys.exit(0) (options, arguments) = getopt.getopt(sys.argv[1:], "dfp:tigv") verbose = 0 -- cgit v1.2.3