Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check

in the limited ABI
This commit is contained in:
Martin v. Löwis 2011-02-05 20:35:29 +00:00
parent 9b142aaae8
commit 738236dbd6
7 changed files with 32 additions and 1 deletions

View file

@ -50,8 +50,14 @@ Xxo_dealloc(XxoObject *self)
static PyObject *
Xxo_demo(XxoObject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ":demo"))
PyObject *o = NULL;
if (!PyArg_ParseTuple(args, "|O:demo", &o))
return NULL;
/* Test availability of fast type checks */
if (o != NULL && PyUnicode_Check(o)) {
Py_INCREF(o);
return o;
}
Py_INCREF(Py_None);
return Py_None;
}