Commit 51028956 authored by Victor Stinner's avatar Victor Stinner

Cleanup dictobject.c

parent 212922a0
......@@ -2589,11 +2589,14 @@ static PyObject *
dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PyObject *self;
PyDictObject *d;
assert(type != NULL && type->tp_alloc != NULL);
self = type->tp_alloc(type, 0);
if (self != NULL) {
PyDictObject *d = (PyDictObject *)self;
if (self == NULL)
return NULL;
d = (PyDictObject *)self;
d->ma_keys = new_keys_object(PyDict_MINSIZE_COMBINED);
/* XXX - Should we raise a no-memory error? */
if (d->ma_keys == NULL) {
......@@ -2605,7 +2608,6 @@ dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
/* The object has been implicitly tracked by tp_alloc */
if (type == &PyDict_Type)
_PyObject_GC_UNTRACK(d);
}
return self;
}
......
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