(txt)
| 633 | @unittest.skipIf(support.is_wasi, "exhausts limited stack on WASI") |
| 634 | def test_fstring_nested_too_deeply(self): |
| 635 | def raises_syntax_or_memory_error(txt): |
| 636 | try: |
| 637 | eval(txt) |
| 638 | except SyntaxError: |
| 639 | pass |
| 640 | except MemoryError: |
| 641 | pass |
| 642 | except Exception as ex: |
| 643 | self.fail(f"Should raise SyntaxError or MemoryError, not {type(ex)}") |
| 644 | else: |
| 645 | self.fail("No exception raised") |
| 646 | |
| 647 | raises_syntax_or_memory_error('f"{1+2:{1+2:{1+1:{1}}}}"') |
| 648 |