Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a7e5da

Browse files
committed
Fix code indentation.
1 parent d8f37ad commit 8a7e5da

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

Doc/library/ssl.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -768,11 +768,11 @@ To test for the presence of SSL support in a Python installation, user code
768768
should use the following idiom::
769769

770770
try:
771-
import ssl
771+
import ssl
772772
except ImportError:
773-
pass
773+
pass
774774
else:
775-
[ do something that requires SSL support ]
775+
... # do something that requires SSL support
776776

777777
Client-side operation
778778
^^^^^^^^^^^^^^^^^^^^^
@@ -883,26 +883,26 @@ new socket from the other end, and use the context's :meth:`SSLContext.wrap_sock
883883
method to create a server-side SSL socket for the connection::
884884

885885
while True:
886-
newsocket, fromaddr = bindsocket.accept()
887-
connstream = context.wrap_socket(newsocket, server_side=True)
888-
try:
889-
deal_with_client(connstream)
890-
finally:
891-
connstream.close()
886+
newsocket, fromaddr = bindsocket.accept()
887+
connstream = context.wrap_socket(newsocket, server_side=True)
888+
try:
889+
deal_with_client(connstream)
890+
finally:
891+
connstream.close()
892892

893893
Then you'll read data from the ``connstream`` and do something with it till you
894894
are finished with the client (or the client is finished with you)::
895895

896896
def deal_with_client(connstream):
897-
data = connstream.recv(1024)
898-
# empty data means the client is finished with us
899-
while data:
900-
if not do_something(connstream, data):
901-
# we'll assume do_something returns False
902-
# when we're finished with client
903-
break
904-
data = connstream.recv(1024)
905-
# finished with client
897+
data = connstream.recv(1024)
898+
# empty data means the client is finished with us
899+
while data:
900+
if not do_something(connstream, data):
901+
# we'll assume do_something returns False
902+
# when we're finished with client
903+
break
904+
data = connstream.recv(1024)
905+
# finished with client
906906

907907
And go back to listening for new client connections (of course, a real server
908908
would probably handle each client connection in a separate thread, or put

0 commit comments

Comments
 (0)