MCPcopy
hub / github.com/sshuttle/sshuttle / _nb_clean

Function _nb_clean

sshuttle/ssnet.py:77–89  ·  view source on GitHub ↗
(func, *args)

Source from the content-addressed store, hash-verified

75
76
77def _nb_clean(func, *args):
78 try:
79 return func(*args)
80 except (OSError, socket.error):
81 # Note: In python2 socket.error != OSError (In python3, they are same)
82 _, e = sys.exc_info()[:2]
83 if e.errno in (errno.EWOULDBLOCK, errno.EAGAIN):
84 debug3('%s: err was: %s' % (func.__name__, e))
85 return None
86 else:
87 # Re-raise other errors (including EPIPE) so they can be handled
88 # by the calling function appropriately
89 raise
90
91
92def _try_peername(sock):

Callers 4

uwriteMethod · 0.85
ureadMethod · 0.85
flushMethod · 0.85
fillMethod · 0.85

Calls 1

debug3Function · 0.90

Tested by

no test coverage detected