mirror of https://github.com/python/cpython
Test for NULL returned from PyObject_NEW().
This commit is contained in:
parent
f0b315478b
commit
9e8f4ea0aa
|
@ -19,6 +19,9 @@ PyRange_New(long start, long len, long step, int reps)
|
|||
{
|
||||
rangeobject *obj = PyObject_NEW(rangeobject, &PyRange_Type);
|
||||
|
||||
if (obj == NULL)
|
||||
return NULL;
|
||||
|
||||
obj->start = start;
|
||||
obj->len = len;
|
||||
obj->step = step;
|
||||
|
|
Loading…
Reference in New Issue