aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/getargs.c
diff options
context:
space:
mode:
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 00e330dc5d3..550d0df6950 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)
{