Mercurial > cpython-lru_cache-weakref
comparison Python/Python-ast.c @ 82750:cc7a94efb1b7
bump Python-ast.c
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Mon, 18 Mar 2013 23:40:53 -0700 |
| parents | c8ccc0519247 |
| children | 12cbb5183d98 |
comparison
equal
deleted
inserted
replaced
| 82749:8e44c9a254ce | 82750:cc7a94efb1b7 |
|---|---|
| 770 return 0; | 770 return 0; |
| 771 } | 771 } |
| 772 | 772 |
| 773 static int exists_not_none(PyObject *obj, _Py_Identifier *id) | 773 static int exists_not_none(PyObject *obj, _Py_Identifier *id) |
| 774 { | 774 { |
| 775 int isnone; | |
| 775 PyObject *attr = _PyObject_GetAttrId(obj, id); | 776 PyObject *attr = _PyObject_GetAttrId(obj, id); |
| 776 if (!attr) { | 777 if (!attr) { |
| 777 PyErr_Clear(); | 778 PyErr_Clear(); |
| 778 return 0; | 779 return 0; |
| 779 } | 780 } |
| 780 int isnone = attr == Py_None; | 781 isnone = attr == Py_None; |
| 781 Py_DECREF(attr); | 782 Py_DECREF(attr); |
| 782 return !isnone; | 783 return !isnone; |
| 783 } | 784 } |
| 784 | 785 |
| 785 | 786 |
