8000 Fix default argument of host · pkdevboxy/PyMySQL@c54fd35 · GitHub
[go: up one dir, main page]

Skip to content

Commit c54fd35

Browse files
committed
Fix default argument of host
fixes PyMySQL#389
1 parent f679acd commit c54fd35

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