Skip to content

Commit 1c02b7e

Browse files
committed
Avoid DECREF calls on None.
1 parent af8728d commit 1c02b7e

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

Python/_warnings.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ get_warnings_context_filters(PyInterpreterState *interp)
285285
return NULL;
286286
}
287287
if (ctx == Py_None) {
288-
Py_DECREF(ctx);
289288
Py_RETURN_NONE;
290289
}
291290
PyObject *context_filters = PyObject_GetAttr(ctx, &_Py_ID(_filters));
@@ -509,7 +508,6 @@ get_filter(PyInterpreterState *interp, PyObject *category,
509508
}
510509
if (context_filters == Py_None) {
511510
use_global_filters = true;
512-
Py_DECREF(context_filters);
513511
} else {
514512
PyObject *context_action = NULL;
515513
if (!filter_search(interp, category, text, lineno, module, "_warnings_context _filters",

0 commit comments

Comments
 (0)