From: Guido van Rossum Date: Fri, 22 May 1998 00:57:31 +0000 (+0000) Subject: I think there was a tiny bug in new_function() -- the 'defaults' X-Git-Tag: v1.5.2a1~564 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b88679b2a4956109e11df64f463fdc36b4c1d67d;p=python I think there was a tiny bug in new_function() -- the 'defaults' argument was initialized to Py_None, but later checked for NULL. Consistently use Py_None. --- diff --git a/Modules/newmodule.c b/Modules/newmodule.c index 7446b975df..cfe78834c1 100644 --- a/Modules/newmodule.c +++ b/Modules/newmodule.c @@ -109,7 +109,7 @@ new_function(unused, args) Py_XDECREF(newfunc->func_name); newfunc->func_name = name; } - if (defaults != NULL) { + if (defaults != Py_None) { Py_XINCREF(defaults); Py_XDECREF(newfunc->func_defaults); newfunc->func_defaults = defaults;