#NEWLINE# def wrap_error( func , * args , **kw ) : #NEWLINE# #INDENT# '\n        Wrap socket.error, IOError, OSError, select.error to raise new specialized\n        exceptions of Python 3.3 like InterruptedError (PEP 3151).\n        ' #NEWLINE# try : #NEWLINE# #INDENT# return func ( * args , ** kw ) #NEWLINE# #UNINDENT# except ( socket . error , IOError , OSError ) as exc : #NEWLINE# #INDENT# if hasattr ( exc , 'winerror' ) : #NEWLINE# #INDENT# _wrap_error ( exc , _MAP_ERRNO , exc . winerror ) #NEWLINE# #UNINDENT# _wrap_error ( exc , _MAP_ERRNO , exc . errno ) #NEWLINE# raise #NEWLINE# #UNINDENT# except select . error as exc : #NEWLINE# #INDENT# if exc . args : #NEWLINE# #INDENT# _wrap_error ( args , _MAP_ERRNO , exc . args [ 0 ] ) #NEWLINE# #UNINDENT# raise