Fix refcount.

This commit is contained in:
Raymond Hettinger 2015-09-13 02:41:18 -04:00
parent 5944e251df
commit 95e2cc5d12
1 changed files with 4 additions and 1 deletions

View File

@ -616,11 +616,14 @@ static PyObject *
deque_repeat(dequeobject *deque, Py_ssize_t n)
{
dequeobject *new_deque;
PyObject *rv;
new_deque = (dequeobject *)deque_copy((PyObject *) deque);
if (new_deque == NULL)
return NULL;
return deque_inplace_repeat(new_deque, n);
rv = deque_inplace_repeat(new_deque, n);
Py_DECREF(new_deque);
return rv;
}
/* The rotate() method is part of the public API and is used internally