summaryrefslogtreecommitdiff
path: root/Modules/_collectionsmodule.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-12-13 00:08:37 +0000
committerRaymond Hettinger <python@rcn.com>2007-12-13 00:08:37 +0000
commitadf9ffdfbe0fb00f5a47444c1dc53eb280d0bd0a (patch)
treed006a49e33601df220458519b651e15660108b26 /Modules/_collectionsmodule.c
parent842c178442a9b9b855d9773dbe2e8ac3d6d79895 (diff)
downloadcpython-git-adf9ffdfbe0fb00f5a47444c1dc53eb280d0bd0a.tar.gz
Fix bug 1604. deque.__init__() did not clear existing contents like list.__init__. Not a backport candidate.
Diffstat (limited to 'Modules/_collectionsmodule.c')
-rw-r--r--Modules/_collectionsmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index e5c3218212..9efbc27ae0 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -843,6 +843,7 @@ deque_init(dequeobject *deque, PyObject *args, PyObject *kwdargs)
}
}
deque->maxlen = maxlen;
+ deque_clear(deque);
if (iterable != NULL) {
PyObject *rv = deque_extend(deque, iterable);
if (rv == NULL)