]> granicus.if.org Git - python/commitdiff
I think there was a tiny bug in new_function() -- the 'defaults'
authorGuido van Rossum <guido@python.org>
Fri, 22 May 1998 00:57:31 +0000 (00:57 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 22 May 1998 00:57:31 +0000 (00:57 +0000)
argument was initialized to Py_None, but later checked for NULL.
Consistently use Py_None.

Modules/newmodule.c

index 7446b975df893cbde963239f99a2386aff9d3e84..cfe78834c10936ea9e01ba790174785ebece81e8 100644 (file)
@@ -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;