]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed deleting func_defaults causes segmentation fault bug
authorMoshe Zadka <moshez@math.huji.ac.il>
Fri, 30 Mar 2001 20:26:32 +0000 (20:26 +0000)
committerMoshe Zadka <moshez@math.huji.ac.il>
Fri, 30 Mar 2001 20:26:32 +0000 (20:26 +0000)
Misc/NEWS
Objects/funcobject.c

index 48c84b6ed10d38fbc2ed84ee754880242a1c77f2..f4e038386e249cb0117eb563946ceaf54a685198 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -50,6 +50,8 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=<id>&group_id=5470&atid
 
 - Add TELL64() hack #ifdef to FreeBSD, Apple and BSDI
 
+- del func.func_defaults raises a TypeError instead of dumping core
+
 What's New in Python 2.0?
 =========================
 
index 8b045f4695ea2f6c2903d4144d632971ac6c7a6f..e312ffd55ea110154cec3e16c79763dd08ce6e14 100644 (file)
@@ -129,7 +129,8 @@ func_setattr(PyFunctionObject *op, char *name, PyObject *value)
                }
        }
        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");