Skip to content

Commit 95def8e

Browse files
committed
Add skip conditions for test_filter_deep_nesting_recursion_error and update the cleanup function of filter_clear
1 parent 757bd88 commit 95def8e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Lib/test/test_builtin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,6 @@ def test_filter_pickle(self):
11211121

11221122
@support.skip_wasi_stack_overflow()
11231123
@support.skip_emscripten_stack_overflow()
1124-
@support.requires_resource('cpu')
11251124
def test_filter_dealloc(self):
11261125
# Tests recursive deallocation of nested filter objects using the
11271126
# thrashcan mechanism. See gh-102356 for more details.
@@ -1131,8 +1130,10 @@ def test_filter_dealloc(self):
11311130
i = filter(bool, i)
11321131
del i
11331132
gc.collect()
1134-
1135-
1133+
6
1134+
@support.skip_wasi_stack_overflow()
1135+
@support.skip_emscripten_stack_overflow()
1136+
@support.requires_resource('cpu')
11361137
def test_filter_deep_nesting_recursion_error(self):
11371138
# gh-137894: Test that deeply nested filter() iterator chains
11381139
# raise RecursionError instead of causing segmentation fault.

Python/bltinmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ PyTypeObject PyFilter_Type = {
670670
Py_TPFLAGS_BASETYPE, /* tp_flags */
671671
filter_doc, /* tp_doc */
672672
filter_traverse, /* tp_traverse */
673-
filter_clear, /* tp_clear */
673+
filter_clear, /* tp_clear */
674674
0, /* tp_richcompare */
675675
0, /* tp_weaklistoffset */
676676
PyObject_SelfIter, /* tp_iter */

0 commit comments

Comments
 (0)