summaryrefslogtreecommitdiffstats
path: root/Python/_warnings.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 3c048af..e42b7c3 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -1395,18 +1395,13 @@ _PyWarnings_Init(void)
goto error;
}
- Py_INCREF(st->filters);
- if (PyModule_AddObject(m, "filters", st->filters) < 0) {
+ if (PyModule_AddObjectRef(m, "filters", st->filters) < 0) {
goto error;
}
-
- Py_INCREF(st->once_registry);
- if (PyModule_AddObject(m, "_onceregistry", st->once_registry) < 0) {
+ if (PyModule_AddObjectRef(m, "_onceregistry", st->once_registry) < 0) {
goto error;
}
-
- Py_INCREF(st->default_action);
- if (PyModule_AddObject(m, "_defaultaction", st->default_action) < 0) {
+ if (PyModule_AddObjectRef(m, "_defaultaction", st->default_action) < 0) {
goto error;
}