mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Test for NULL returned from PyObject_NEW().
This commit is contained in:
parent
f0b315478b
commit
9e8f4ea0aa
1 changed files with 3 additions and 0 deletions
|
@ -19,6 +19,9 @@ PyRange_New(long start, long len, long step, int reps)
|
||||||
{
|
{
|
||||||
rangeobject *obj = PyObject_NEW(rangeobject, &PyRange_Type);
|
rangeobject *obj = PyObject_NEW(rangeobject, &PyRange_Type);
|
||||||
|
|
||||||
|
if (obj == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
obj->start = start;
|
obj->start = start;
|
||||||
obj->len = len;
|
obj->len = len;
|
||||||
obj->step = step;
|
obj->step = step;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue