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 7446b97..cfe7883 100644
--- a/Modules/newmodule.c
+++ b/Modules/newmodule.c
@@ -109,7 +109,7 @@
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;