Browse Source

Remove unnecessary return statements in Python sockets error handler

pull/8/head
Joseph Henry 5 years ago
parent
commit
e7eaeadaee
No known key found for this signature in database
GPG Key ID: C45B33FF5EBC9344
  1. 7
      src/bindings/python/sockets.py

7
src/bindings/python/sockets.py

@ -8,25 +8,18 @@ def handle_error(err):
if err == libzt.ZTS_ERR_SOCKET: if err == libzt.ZTS_ERR_SOCKET:
if errno() == libzt.ZTS_EAGAIN: if errno() == libzt.ZTS_EAGAIN:
raise BlockingIOError() raise BlockingIOError()
return
if errno() == libzt.ZTS_EINPROGRESS: if errno() == libzt.ZTS_EINPROGRESS:
raise BlockingIOError() raise BlockingIOError()
return
if errno() == libzt.ZTS_EALREADY: if errno() == libzt.ZTS_EALREADY:
raise BlockingIOError() raise BlockingIOError()
return
if errno() == libzt.ZTS_ECONNABORTED: if errno() == libzt.ZTS_ECONNABORTED:
raise ConnectionAbortedError() raise ConnectionAbortedError()
return
if errno() == libzt.ZTS_ECONNREFUSED: if errno() == libzt.ZTS_ECONNREFUSED:
raise ConnectionRefusedError() raise ConnectionRefusedError()
return
if errno() == libzt.ZTS_ECONNRESET: if errno() == libzt.ZTS_ECONNRESET:
raise ConnectionResetError() raise ConnectionResetError()
return
if errno() == libzt.ZTS_ETIMEDOUT: if errno() == libzt.ZTS_ETIMEDOUT:
raise TimeoutError() raise TimeoutError()
return
raise Exception("ZTS_ERR_SOCKET (" + str(err) + ")") raise Exception("ZTS_ERR_SOCKET (" + str(err) + ")")
if err == libzt.ZTS_ERR_SERVICE: if err == libzt.ZTS_ERR_SERVICE:
raise Exception("ZTS_ERR_SERVICE (" + str(err) + ")") raise Exception("ZTS_ERR_SERVICE (" + str(err) + ")")

Loading…
Cancel
Save