Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check
in the limited ABI
diff --git a/Modules/xxlimited.c b/Modules/xxlimited.c
index bd3f178..5a6df8f 100644
--- a/Modules/xxlimited.c
+++ b/Modules/xxlimited.c
@@ -50,8 +50,14 @@
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;
}