summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-05-31 04:34:34 (GMT)
committerGitHub <noreply@github.com>2018-05-31 04:34:34 (GMT)
commita5c42284e69fb309bdd17ee8c1c120d1be383012 (patch)
tree4309186f7e192e3ac29a8992f81de906211feb51 /Modules
parent5d6c7ed5e340b2311a15f34e968d4bef09c71922 (diff)
downloadcpython-a5c42284e69fb309bdd17ee8c1c120d1be383012.zip
cpython-a5c42284e69fb309bdd17ee8c1c120d1be383012.tar.gz
cpython-a5c42284e69fb309bdd17ee8c1c120d1be383012.tar.bz2
bpo-33677: Fix signatures of tp_clear handlers for AST and deque. (GH-7196)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_collectionsmodule.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index 55132e7..65d556c 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -575,7 +575,7 @@ deque_concat(dequeobject *deque, PyObject *other)
return new_deque;
}
-static void
+static int
deque_clear(dequeobject *deque)
{
block *b;
@@ -587,7 +587,7 @@ deque_clear(dequeobject *deque)
PyObject **itemptr, **limit;
if (Py_SIZE(deque) == 0)
- return;
+ return 0;
/* During the process of clearing a deque, decrefs can cause the
deque to mutate. To avoid fatal confusion, we have to make the
@@ -648,7 +648,7 @@ deque_clear(dequeobject *deque)
}
CHECK_END(leftblock->rightlink);
freeblock(leftblock);
- return;
+ return 0;
alternate_method:
while (Py_SIZE(deque)) {
@@ -656,6 +656,7 @@ deque_clear(dequeobject *deque)
assert (item != NULL);
Py_DECREF(item);
}
+ return 0;
}
static PyObject *