diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-25 11:23:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-25 11:23:47 (GMT) |
commit | 32d96a2b5bc3136d45a66adbdb45fac351b520ce (patch) | |
tree | acf51c9945f764ab103597c9cba376f154aa600d /Python/getargs.c | |
parent | 65ce60aef150776f884715b4315a10a0d6ae769e (diff) | |
download | cpython-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.c | 8 |
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) { |