summaryrefslogtreecommitdiff
path: root/Modules/clinic/_datetimemodule.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/clinic/_datetimemodule.c.h')
-rw-r--r--Modules/clinic/_datetimemodule.c.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/Modules/clinic/_datetimemodule.c.h b/Modules/clinic/_datetimemodule.c.h
index 36b4fcac47..447036ca03 100644
--- a/Modules/clinic/_datetimemodule.c.h
+++ b/Modules/clinic/_datetimemodule.c.h
@@ -36,16 +36,23 @@ datetime_datetime_now(PyTypeObject *type, PyObject *const *args, Py_ssize_t narg
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"tz", NULL};
- static _PyArg_Parser _parser = {"|O:now", _keywords, 0};
+ static _PyArg_Parser _parser = {NULL, _keywords, "now", 0};
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
PyObject *tz = Py_None;
- if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
- &tz)) {
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
goto exit;
}
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ tz = args[0];
+skip_optional_pos:
return_value = datetime_datetime_now_impl(type, tz);
exit:
return return_value;
}
-/*[clinic end generated code: output=b3d746843403a8ce input=a9049054013a1b77]*/
+/*[clinic end generated code: output=aae916ab728ca85b input=a9049054013a1b77]*/