Skip to content

Commit 2330bf7

Browse files
brettl-sprintmethane
authored andcommitted
Raise more graceful error when port is not int (#820)
1 parent a4f9847 commit 2330bf7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pymysql/connections.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ def _config(key, arg):
254254

255255
self.host = host or "localhost"
256256
self.port = port or 3306
257+
if type(self.port) is not int:
258+
raise ValueError("port should be of type int")
257259
self.user = user or DEFAULT_USER
258260
self.password = password or b""
259261
if isinstance(self.password, text_type):

0 commit comments

Comments
 (0)