summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-02-05 20:35:29 +0000
committerMartin v. Löwis <martin@v.loewis.de>2011-02-05 20:35:29 +0000
commit738236dbd62aab5f0cf27f9ba0f2de3cb65802d2 (patch)
treeb531bab8d3e4272e931f74297c988f9b26f71f9e /Modules
parent9b142aaae8581cc436c5a822bfac57e1687f6743 (diff)
downloadcpython-git-738236dbd62aab5f0cf27f9ba0f2de3cb65802d2.tar.gz
Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check
in the limited ABI
Diffstat (limited to 'Modules')
-rw-r--r--Modules/xxlimited.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/xxlimited.c b/Modules/xxlimited.c
index bd3f1783e6..5a6df8f2d8 100644
--- a/Modules/xxlimited.c
+++ b/Modules/xxlimited.c
@@ -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;
}