Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit974847b

Browse files
authored
gh-111800: Fixtest_recursive_repr fromtest_io under WASI to not recurse so deeply (GH-112150)
1 parent762eb58 commit974847b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

‎Lib/test/test_io.py

Lines 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-
withsupport.swap_attr(raw,'name',b):
1238-
try:
1237+
withsupport.swap_attr(raw,'name',b),support.infinite_recursion(25):
1238+
withself.assertRaises(RuntimeError):
12391239
repr(b)# Should not crash
1240-
exceptRuntimeError:
1241-
pass
12421240

12431241
deftest_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-
withsupport.swap_attr(raw,'name',t):
2805-
try:
2802+
withsupport.swap_attr(raw,'name',t),support.infinite_recursion(25):
2803+
withself.assertRaises(RuntimeError):
28062804
repr(t)# Should not crash
2807-
exceptRuntimeError:
2808-
pass
28092805

28102806
deftest_line_buffering(self):
28112807
r=self.BytesIO()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp