From 6c8573cb69a89610c139e6a2318d8f449e43e3ee Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 13:25:44 +0900 Subject: [PATCH] _mysql: db -> database, passwd -> password --- MySQLdb/_mysql.c | 2 +- MySQLdb/connections.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MySQLdb/_mysql.c b/MySQLdb/_mysql.c index 27880ca2..0f6e9f5c 100644 --- a/MySQLdb/_mysql.c +++ b/MySQLdb/_mysql.c @@ -414,7 +414,7 @@ _mysql_ConnectionObject_Initialize( *db = NULL, *unix_socket = NULL; unsigned int port = 0; unsigned int client_flag = 0; - static char *kwlist[] = { "host", "user", "passwd", "db", "port", + static char *kwlist[] = { "host", "user", "password", "database", "port", "unix_socket", "conv", "connect_timeout", "compress", "named_pipe", "init_command", diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index 482b12f0..89cb7c9a 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -148,10 +148,10 @@ class object, used to create cursors (keyword only) kwargs2 = kwargs.copy() - if "database" in kwargs2: - kwargs2["db"] = kwargs2.pop("database") - if "password" in kwargs2: - kwargs2["passwd"] = kwargs2.pop("password") + if "db" in kwargs2: + kwargs2["database"] = kwargs2.pop("db") + if "passwd" in kwargs2: + kwargs2["password"] = kwargs2.pop("passwd") if "conv" in kwargs: conv = kwargs["conv"]