mirror of https://github.com/python/cpython
fix error handling
This commit is contained in:
parent
49a6b0ef70
commit
7285a2666e
|
@ -85,11 +85,12 @@ initfuture_builtins(void)
|
||||||
if (itertools == NULL)
|
if (itertools == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* If anything in the following loop fails, we fall through. */
|
||||||
for (cur_func = it_funcs; *cur_func; ++cur_func){
|
for (cur_func = it_funcs; *cur_func; ++cur_func){
|
||||||
iter_func = PyObject_GetAttrString(itertools, *cur_func);
|
iter_func = PyObject_GetAttrString(itertools, *cur_func);
|
||||||
if (iter_func == NULL)
|
if (iter_func == NULL ||
|
||||||
return;
|
PyModule_AddObject(m, *cur_func+1, iter_func) < 0)
|
||||||
PyModule_AddObject(m, *cur_func+1, iter_func);
|
break;
|
||||||
}
|
}
|
||||||
Py_DECREF(itertools);
|
Py_DECREF(itertools);
|
||||||
/* any other initialization needed */
|
/* any other initialization needed */
|
||||||
|
|
Loading…
Reference in New Issue