summaryrefslogtreecommitdiffstats
path: root/Doc/library/socket.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-01-03 21:26:05 (GMT)
committerGeorg Brandl <georg@python.org>2009-01-03 21:26:05 (GMT)
commita1c6a1cea5af1d3c7682a8e99b001b0904480e4d (patch)
tree85461d1ba5237440b36f253b197779190226a294 /Doc/library/socket.rst
parent48310cd3f2e02ced9ae836ccbcb67e9af3097d62 (diff)
downloadcpython-a1c6a1cea5af1d3c7682a8e99b001b0904480e4d.zip
cpython-a1c6a1cea5af1d3c7682a8e99b001b0904480e4d.tar.gz
cpython-a1c6a1cea5af1d3c7682a8e99b001b0904480e4d.tar.bz2
Merged revisions 68221 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68221 | georg.brandl | 2009-01-03 22:04:55 +0100 (Sat, 03 Jan 2009) | 2 lines Remove tabs from the documentation. ........
Diffstat (limited to 'Doc/library/socket.rst')
-rw-r--r--Doc/library/socket.rst30
1 files changed, 15 insertions, 15 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index c2e3d91..f399dae 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -797,17 +797,17 @@ sends traffic to the first one connected successfully. ::
socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
af, socktype, proto, canonname, sa = res
try:
- s = socket.socket(af, socktype, proto)
+ s = socket.socket(af, socktype, proto)
except socket.error as msg:
- s = None
- continue
+ s = None
+ continue
try:
- s.bind(sa)
- s.listen(1)
+ s.bind(sa)
+ s.listen(1)
except socket.error as msg:
- s.close()
- s = None
- continue
+ s.close()
+ s = None
+ continue
break
if s is None:
print('could not open socket')
@@ -832,16 +832,16 @@ sends traffic to the first one connected successfully. ::
for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
try:
- s = socket.socket(af, socktype, proto)
+ s = socket.socket(af, socktype, proto)
except socket.error as msg:
- s = None
- continue
+ s = None
+ continue
try:
- s.connect(sa)
+ s.connect(sa)
except socket.error as msg:
- s.close()
- s = None
- continue
+ s.close()
+ s = None
+ continue
break
if s is None:
print('could not open socket')