Mercurial > cpython-lru_cache-weakref
diff Objects/funcobject.c @ 17266:9ddbb76c3114 2.0
Fixed deleting func_defaults causes segmentation fault bug
| author | Moshe Zadka <moshez@math.huji.ac.il> |
|---|---|
| date | Fri, 30 Mar 2001 20:26:32 +0000 |
| parents | 6f6f965c5e2d |
| children |
line wrap: on
line diff
--- a/Objects/funcobject.c Fri Mar 30 20:06:55 2001 +0000 +++ b/Objects/funcobject.c Fri Mar 30 20:26:32 2001 +0000 @@ -129,7 +129,8 @@ } } else if (strcmp(name, "func_defaults") == 0) { - if (value != Py_None && !PyTuple_Check(value)) { + if (value != Py_None && + (value == NULL || !PyTuple_Check(value))) { PyErr_SetString( PyExc_TypeError, "func_defaults must be set to a tuple object");
