Commit 68e51613 authored by Sebastian Berg's avatar Sebastian Berg Committed by Stefan Behnel

BUG: Fix reference count issues (GH-3022)

parent f8cd55f2
......@@ -685,9 +685,11 @@ static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject
return PyLong_FromUnsignedLongLong(value);
#endif
} else {
PyObject *one = PyInt_FromLong(1L);
PyObject *result, *one = PyInt_FromLong(1L);
if (unlikely(!one)) return NULL;
return PyNumber_Lshift(one, exp);
result = PyNumber_Lshift(one, exp);
Py_DECREF(one);
return result;
}
} else if (shiftby == -1 && PyErr_Occurred()) {
PyErr_Clear();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment