From c525e43b426bc56c775bd0976bebb6f5632f0b3c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 9 Dec 1997 20:37:25 +0000 Subject: [PATCH] Add a test for a bad format character. --- Modules/xxmodule.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Modules/xxmodule.c b/Modules/xxmodule.c index 792ef3f3bb..8de3c5d3cf 100644 --- a/Modules/xxmodule.c +++ b/Modules/xxmodule.c @@ -208,10 +208,26 @@ xx_bug(self, args) return Py_None; } +/* Test bad format character */ + +static PyObject * +xx_roj(self, args) + PyObject *self; /* Not used */ + PyObject *args; +{ + PyObject *a; + long b; + if (!PyArg_ParseTuple(args, "O#", &a, &b)) + return NULL; + Py_INCREF(Py_None); + return Py_None; +} + /* List of functions defined in the module */ static PyMethodDef xx_methods[] = { + {"roj", xx_roj, 1}, {"foo", xx_foo, 1}, {"new", xx_new, 1}, {"bug", xx_bug, 1}, -- 2.50.0