From a564989b41cdc499cd39f78f14a2e9e6024ace12 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 17 Nov 2019 01:33:34 +0000 Subject: [PATCH] util.c: Fix sense of error check in `popitem'. --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index 5abd7c9..231e00a 100644 --- a/util.c +++ b/util.c @@ -803,7 +803,7 @@ PyObject *gmapmeth_popitem(PyObject *me, PyObject *arg) PyObject *i = 0, *k = 0, *v = 0, *rc = 0; if (!PyArg_ParseTuple(arg, ":popitem") || - (i = PyObject_GetIter(me))) + (i = PyObject_GetIter(me)) == 0) goto end; if ((k = PyIter_Next(i)) == 0) { if (!PyErr_Occurred()) VALERR("popitem(): mapping is empty"); -- 2.11.0