Commit b88679b2 authored by Guido van Rossum's avatar Guido van Rossum

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.
parent c8498dc6
...@@ -109,7 +109,7 @@ new_function(unused, args) ...@@ -109,7 +109,7 @@ new_function(unused, args)
Py_XDECREF(newfunc->func_name); Py_XDECREF(newfunc->func_name);
newfunc->func_name = name; newfunc->func_name = name;
} }
if (defaults != NULL) { if (defaults != Py_None) {
Py_XINCREF(defaults); Py_XINCREF(defaults);
Py_XDECREF(newfunc->func_defaults); Py_XDECREF(newfunc->func_defaults);
newfunc->func_defaults = defaults; newfunc->func_defaults = defaults;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment