8000 Merge pull request #401 from PyMySQL/fix/default-host · pkdevboxy/PyMySQL@7fc5c00 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7fc5c00

Browse files
committed
Merge pull request PyMySQL#401 from PyMySQL/fix/default-host
Fix default argument of host
2 parents f679acd + c54fd35 commit 7fc5c00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymysql/connections.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ class Connection(object):
499499

500500
socket = None
501501

502-
def __init__(self, host="localhost", user=None, password="",
502+
def __init__(self, host=None, user=None, password="",
503503
database=None, port=3306, unix_socket=None,
504504
charset='', sql_mode=None,
505505
read_default_file=None, conv=decoders, use_unicode=None,
@@ -601,7 +601,7 @@ def _config(key, arg):
601601
port = int(_config("port", port))
602602
charset = _config("default-character-set", charset)
603603

604-
self.host = host
604+
self.host = host or "localhost"
605605
self.port = port
606606
self.user = user or DEFAULT_USER
607607
self.password = password or ""

0 commit comments

Comments
 (0)
0