May-13-2020, 03:23 PM
When the documentation says "socket.error" is an exception, the "socket" part is the socket module, not an instance of socket. Everywhere you use "s.error" you should use "socket.error".
Well, maybe you don't want to use socket.error either. PEP 3151 includes a lengthy discussion about broad exceptions like socket.error being too broad and you should use more focused exceptions.
Well, maybe you don't want to use socket.error either. PEP 3151 includes a lengthy discussion about broad exceptions like socket.error being too broad and you should use more focused exceptions.