From 05eb40128e305e07527d317e3964e8a1160d0961 Mon Sep 17 00:00:00 2001 From: Skip Montanaro Date: Tue, 10 Feb 2004 15:51:15 +0000 Subject: Fix indentation error in testGetServByName and rewrite loop to avoid clumsy sentinel variable --- Lib/test/test_socket.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index b2db601..a2b8489 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -273,22 +273,19 @@ class GeneralModuleTests(unittest.TestCase): def testGetServByName(self): # Testing getservbyname() # try a few protocols - not everyone has telnet enabled - found = 0 for proto in ("telnet", "ssh", "www", "ftp"): try: socket.getservbyname(proto, 'tcp') - found = 1 break except socket.error: pass try: socket.getservbyname(proto, 'udp') - found = 1 break except socket.error: pass - if not found: - raise socket.error + else: + raise socket.error def testDefaultTimeout(self): # Testing default timeout -- cgit v0.12