summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2004-02-10 15:51:15 (GMT)
committerSkip Montanaro <skip@pobox.com>2004-02-10 15:51:15 (GMT)
commit05eb40128e305e07527d317e3964e8a1160d0961 (patch)
treedb7971ddd3e7305be787d114e907285dbb580d05
parent029dba5a4078bc1e9dc262d24aaa481936af49d3 (diff)
downloadcpython-05eb40128e305e07527d317e3964e8a1160d0961.zip
cpython-05eb40128e305e07527d317e3964e8a1160d0961.tar.gz
cpython-05eb40128e305e07527d317e3964e8a1160d0961.tar.bz2
Fix indentation error in testGetServByName and rewrite loop to avoid clumsy
sentinel variable
-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