summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_socket.py7
1 files 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