summaryrefslogtreecommitdiffstats
path: root/Python/getargs.c
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 /Python/getargs.c
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 'Python/getargs.c')
-rw-r--r--Python/getargs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 00e330d..550d0df 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -612,6 +612,14 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags,
/* Format an error message generated by convertsimple(). */
+void
+_PyArg_BadArgument(const char *fname, const char *expected, PyObject *arg)
+{
+ PyErr_Format(PyExc_TypeError, "%.200s() argument must be %.50s, not %.50s",
+ fname, expected,
+ arg == Py_None ? "None" : arg->ob_type->tp_name);
+}
+
static const char *
converterr(const char *expected, PyObject *arg, char *msgbuf, size_t bufsize)
{