Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b88679b

Browse files
committed
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.
1 parent c8498dc commit b88679b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/newmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ new_function(unused, args)
109109
Py_XDECREF(newfunc->func_name);
110110
newfunc->func_name = name;
111111
}
112-
if (defaults != NULL) {
112+
if (defaults != Py_None) {
113113
Py_XINCREF(defaults);
114114
Py_XDECREF(newfunc->func_defaults);
115115
newfunc->func_defaults = defaults;

0 commit comments

Comments
 (0)