Visitar URL original
bpo-43094: Update sqlite3 docs to match implementation by erlend-aasland · Pull Request #24489 · python/cpython · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix sqlite3.complete_statement() docstring
  • Loading branch information
Erlend E. Aasland
Erlend E. Aasland committed Feb 9, 2021
commit fe3fda62f17eafac877f8026a7c280f7e18e95e7
8 changes: 4 additions & 4 deletions Modules/_sqlite/clinic/module.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ preserve
[clinic start generated code]*/

PyDoc_STRVAR(pysqlite_complete_statement__doc__,
"complete_statement($module, /, statement)\n"
"complete_statement($module, /, sql)\n"
"--\n"
"\n"
"Checks if a string contains a complete SQL statement. Non-standard.");
Expand All @@ -18,7 +18,7 @@ static PyObject *
pysqlite_complete_statement(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"statement", NULL};
static const char * const _keywords[] = {"sql", NULL};
static _PyArg_Parser _parser = {NULL, _keywords, "complete_statement", 0};
PyObject *argsbuf[1];
const char *statement;
Expand All @@ -28,7 +28,7 @@ pysqlite_complete_statement(PyObject *module, PyObject *const *args, Py_ssize_t
goto exit;
}
if (!PyUnicode_Check(args[0])) {
_PyArg_BadArgument("complete_statement", "argument 'statement'", "str", args[0]);
_PyArg_BadArgument("complete_statement", "argument 'sql'", "str", args[0]);
goto exit;
}
Py_ssize_t statement_length;
Expand Down Expand Up @@ -219,4 +219,4 @@ pysqlite_adapt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
/*[clinic end generated code: output=c0ccdbd197db93bf input=a9049054013a1b77]*/
/*[clinic end generated code: output=450c444476ad31e5 input=a9049054013a1b77]*/
4 changes: 2 additions & 2 deletions Modules/_sqlite/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ RAM instead of on disk.");
/*[clinic input]
_sqlite3.complete_statement as pysqlite_complete_statement

statement: str
sql as statement: str

Checks if a string contains a complete SQL statement. Non-standard.
[clinic start generated code]*/

static PyObject *
pysqlite_complete_statement_impl(PyObject *module, const char *statement)
/*[clinic end generated code: output=e55f1ff1952df558 input=f6b24996b31c5c33]*/
/*[clinic end generated code: output=e55f1ff1952df558 input=3ed6064706d8647d]*/
{
if (sqlite3_complete(statement)) {
return Py_NewRef(Py_True);
Expand Down