Skip to content

Commit dd47caa

Browse files
authored
Remove deprecated socket.error from Connection.connect exception handler (PyMySQL#1062)
Since python 3.3, `socket.error` is a deprecated alias for OSError, which is already included.
1 parent d174835 commit dd47caa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymysql/connections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def connect(self, sock=None):
655655
except: # noqa
656656
pass
657657

658-
if isinstance(e, (OSError, IOError, socket.error)):
658+
if isinstance(e, (OSError, IOError)):
659659
exc = err.OperationalError(
660660
CR.CR_CONN_HOST_ERROR,
661661
"Can't connect to MySQL server on %r (%s)" % (self.host, e),

0 commit comments

Comments
 (0)