Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 974847b

Browse filesBrowse files
authored
gh-111800: Fix test_recursive_repr from test_io under WASI to not recurse so deeply (GH-112150)
1 parent 762eb58 commit 974847b
Copy full SHA for 974847b

File tree

Expand file treeCollapse file tree

1 file changed

+4
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-8
lines changed

‎Lib/test/test_io.py

Copy file name to clipboardExpand all lines: Lib/test/test_io.py
+4-8Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.