Skip to content

Commit

Permalink
Raise more graceful error when port is not int (#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettl-sprint authored and methane committed Nov 21, 2019
1 parent a4f9847 commit 2330bf7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pymysql/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ def _config(key, arg):

self.host = host or "localhost"
self.port = port or 3306
if type(self.port) is not int:
raise ValueError("port should be of type int")
self.user = user or DEFAULT_USER
self.password = password or b""
if isinstance(self.password, text_type):
Expand Down

0 comments on commit 2330bf7

Please sign in to comment.