summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/module.c
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend@python.org>2023-08-14 14:37:44 (GMT)
committerGitHub <noreply@github.com>2023-08-14 14:37:44 (GMT)
commit6fbaba552a52f93ecbe8be000888afa0b65b967e (patch)
tree361cc3c1b564949379612eb7052a7cd58d06d46b /Modules/_sqlite/module.c
parent608927b01447b110de5094271fbc4d49c60130b0 (diff)
downloadcpython-6fbaba552a52f93ecbe8be000888afa0b65b967e.zip
cpython-6fbaba552a52f93ecbe8be000888afa0b65b967e.tar.gz
cpython-6fbaba552a52f93ecbe8be000888afa0b65b967e.tar.bz2
gh-107938: Synchonise the signature of of sqlite3.connect and sqlite3.Connection.__init__ (#107939)
Diffstat (limited to 'Modules/_sqlite/module.c')
-rw-r--r--Modules/_sqlite/module.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index 368e581..0c503df 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -48,25 +48,16 @@ module _sqlite3
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=81e330492d57488e]*/
-// NB: This needs to be in sync with the Connection.__init__ docstring.
-PyDoc_STRVAR(module_connect_doc,
-"connect($module, /, database, timeout=5.0, detect_types=0,\n"
-" isolation_level='', check_same_thread=True,\n"
-" factory=ConnectionType, cached_statements=128, uri=False, *,\n"
-" autocommit=sqlite3.LEGACY_TRANSACTION_CONTROL)\n"
-"--\n"
-"\n"
-"Opens a connection to the SQLite database file database.\n"
-"\n"
-"You can use \":memory:\" to open a database connection to a database that resides\n"
-"in RAM instead of on disk.");
-
-#define PYSQLITE_CONNECT_METHODDEF \
- {"connect", _PyCFunction_CAST(module_connect), METH_FASTCALL|METH_KEYWORDS, module_connect_doc},
+/*
+ * We create 'clinic/_sqlite3.connect.c.h' in connection.c, in order to
+ * keep the signatures of sqlite3.Connection.__init__ and
+ * sqlite3.connect() synchronised.
+ */
+#include "clinic/_sqlite3.connect.c.h"
static PyObject *
-module_connect(PyObject *module, PyObject *const *args, Py_ssize_t nargsf,
- PyObject *kwnames)
+pysqlite_connect(PyObject *module, PyObject *const *args, Py_ssize_t nargsf,
+ PyObject *kwnames)
{
pysqlite_state *state = pysqlite_get_state(module);
PyObject *factory = (PyObject *)state->ConnectionType;