summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/spwdmodule.c.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-12-25 11:23:47 (GMT)
committerGitHub <noreply@github.com>2018-12-25 11:23:47 (GMT)
commit32d96a2b5bc3136d45a66adbdb45fac351b520ce (patch)
treeacf51c9945f764ab103597c9cba376f154aa600d /Modules/clinic/spwdmodule.c.h
parent65ce60aef150776f884715b4315a10a0d6ae769e (diff)
downloadcpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.zip
cpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.tar.gz
cpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.tar.bz2
bpo-23867: Argument Clinic: inline parsing code for a single positional parameter. (GH-9689)
Diffstat (limited to 'Modules/clinic/spwdmodule.c.h')
-rw-r--r--Modules/clinic/spwdmodule.c.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/clinic/spwdmodule.c.h b/Modules/clinic/spwdmodule.c.h
index b2479ff..a0a3e2e 100644
--- a/Modules/clinic/spwdmodule.c.h
+++ b/Modules/clinic/spwdmodule.c.h
@@ -24,9 +24,14 @@ spwd_getspnam(PyObject *module, PyObject *arg_)
PyObject *return_value = NULL;
PyObject *arg;
- if (!PyArg_Parse(arg_, "U:getspnam", &arg)) {
+ if (!PyUnicode_Check(arg_)) {
+ _PyArg_BadArgument("getspnam", "str", arg_);
goto exit;
}
+ if (PyUnicode_READY(arg_) == -1) {
+ goto exit;
+ }
+ arg = arg_;
return_value = spwd_getspnam_impl(module, arg);
exit:
@@ -66,4 +71,4 @@ spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored))
#ifndef SPWD_GETSPALL_METHODDEF
#define SPWD_GETSPALL_METHODDEF
#endif /* !defined(SPWD_GETSPALL_METHODDEF) */
-/*[clinic end generated code: output=07cd8af0afd77fe7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=44a7c196d4b48f4e input=a9049054013a1b77]*/