Test for NULL returned from PyObject_NEW().

This commit is contained in:
Guido van Rossum 2000-12-14 14:59:53 +00:00
parent f0b315478b
commit 9e8f4ea0aa
1 changed files with 3 additions and 0 deletions

View File

@ -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;