#NEWLINE# @ contextlib . contextmanager #NEWLINE# def wrapped_socket_errnos( * errnos ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( yield ) #NEWLINE# #UNINDENT# except socket . SocketError as error : #NEWLINE# #INDENT# socket_errno = error . args [ 0 ] #NEWLINE# if ( socket_errno in errnos ) : #NEWLINE# #INDENT# raise _ConnectionLost ( os . strerror ( socket_errno ) ) #NEWLINE# #UNINDENT# raise