summaryrefslogtreecommitdiff
path: root/Objects/genobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2017-02-06 07:15:57 -0800
committerRaymond Hettinger <python@rcn.com>2017-02-06 07:15:57 -0800
commit826745ba953b4ef23462fb0bc2d7b3db23b51d89 (patch)
tree7789cc87df07c2786c40e6888cbb532a94ce6334 /Objects/genobject.c
parent95b272b4e0d5438a12702e51e05d03f5a5a8e505 (diff)
parent515f1cf20f4e9656b1bcda236bad8ed0e33770f0 (diff)
downloadcpython-826745ba953b4ef23462fb0bc2d7b3db23b51d89.tar.gz
merge
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 2680ab0e12..24a1da6f3e 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -402,8 +402,7 @@ gen_close(PyGenObject *gen, PyObject *args)
if (PyErr_ExceptionMatches(PyExc_StopIteration)
|| PyErr_ExceptionMatches(PyExc_GeneratorExit)) {
PyErr_Clear(); /* ignore these errors */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return NULL;
}
@@ -1341,7 +1340,7 @@ async_gen_init_hooks(PyAsyncGenObject *o)
PyObject *res;
Py_INCREF(firstiter);
- res = PyObject_CallFunction(firstiter, "O", o);
+ res = PyObject_CallFunctionObjArgs(firstiter, o, NULL);
Py_DECREF(firstiter);
if (res == NULL) {
return 1;