File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -1234,11 +1234,9 @@ def test_recursive_repr(self):
12341234 # Issue #25455
12351235 raw = self .MockRawIO ()
12361236 b = self .tp (raw )
1237- with support .swap_attr (raw , 'name' , b ):
1238- try :
1237+ with support .swap_attr (raw , 'name' , b ), support . infinite_recursion ( 25 ) :
1238+ with self . assertRaises ( RuntimeError ) :
12391239 repr (b ) # Should not crash
1240- except RuntimeError :
1241- pass
12421240
12431241 def test_flush_error_on_close (self ):
12441242 # Test that buffered file is closed despite failed flush
@@ -2801,11 +2799,9 @@ def test_recursive_repr(self):
28012799 # Issue #25455
28022800 raw = self .BytesIO ()
28032801 t = self .TextIOWrapper (raw , encoding = "utf-8" )
2804- with support .swap_attr (raw , 'name' , t ):
2805- try :
2802+ with support .swap_attr (raw , 'name' , t ), support . infinite_recursion ( 25 ) :
2803+ with self . assertRaises ( RuntimeError ) :
28062804 repr (t ) # Should not crash
2807- except RuntimeError :
2808- pass
28092805
28102806 def test_line_buffering (self ):
28112807 r = self .BytesIO ()
You can’t perform that action at this time.
0 commit comments