Minor C API documentation improvements. (GH-17696)

The added parentheses around the PyIter_Next assignment suppress the following warning which gcc throws without:
```
warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
```
The other change is a typo fix
This commit is contained in:
William Ayd 2019-12-24 23:25:56 -05:00 committed by Benjamin Peterson
parent 025eeaa196
commit 5c7ed7550e
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ something like this::
/* propagate error */ /* propagate error */
} }
while (item = PyIter_Next(iterator)) { while ((item = PyIter_Next(iterator))) {
/* do something with item */ /* do something with item */
... ...
/* release reference when done */ /* release reference when done */

View File

@ -37,7 +37,7 @@ PyInit_custom(void)
Py_INCREF(&CustomType); Py_INCREF(&CustomType);
if (PyModule_AddObject(m, "Custom", (PyObject *) &CustomType) < 0) { if (PyModule_AddObject(m, "Custom", (PyObject *) &CustomType) < 0) {
Py_DECREF(&CustomType); Py_DECREF(&CustomType);
PY_DECREF(m); Py_DECREF(m);
return NULL; return NULL;
} }