Skip to content

Commit 21366c3

Browse files
committed
Fix logic error in test
1 parent 704c336 commit 21366c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_fstring.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,13 +635,14 @@ def test_fstring_nested_too_deeply(self):
635635
def raises_syntax_or_memory_error(txt):
636636
try:
637637
eval(txt)
638-
self.fail("No exception raised")
639638
except SyntaxError:
640639
pass
641640
except MemoryError:
642641
pass
643642
except Exception as ex:
644643
self.fail(f"Should raise SyntaxError or MemoryError, not {type(ex)}")
644+
else:
645+
self.fail("No exception raised")
645646

646647
raises_syntax_or_memory_error('f"{1+2:{1+2:{1+1:{1}}}}"')
647648

0 commit comments

Comments
 (0)