mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bump Python-ast.c
This commit is contained in:
parent
7654ab9ef0
commit
3a61943b7b
1 changed files with 2 additions and 1 deletions
|
@ -772,12 +772,13 @@ static int add_ast_fields(void)
|
||||||
|
|
||||||
static int exists_not_none(PyObject *obj, _Py_Identifier *id)
|
static int exists_not_none(PyObject *obj, _Py_Identifier *id)
|
||||||
{
|
{
|
||||||
|
int isnone;
|
||||||
PyObject *attr = _PyObject_GetAttrId(obj, id);
|
PyObject *attr = _PyObject_GetAttrId(obj, id);
|
||||||
if (!attr) {
|
if (!attr) {
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int isnone = attr == Py_None;
|
isnone = attr == Py_None;
|
||||||
Py_DECREF(attr);
|
Py_DECREF(attr);
|
||||||
return !isnone;
|
return !isnone;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue