mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check
in the limited ABI
This commit is contained in:
parent
9b142aaae8
commit
738236dbd6
7 changed files with 32 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue