These constants are platform-dependent.  If we're going to check errno here we must compare to the constants in the errno module (e.g. errno.ECONNREFUSED).  However, I'm not sure it's worth it; it's probably enough to just check that a socket.error (or even just an IOError) is raised.