(self)
| 621 | self.fail("exec should have failed, because code contained free vars") |
| 622 | |
| 623 | def testListCompLocalVars(self): |
| 624 | |
| 625 | try: |
| 626 | print(bad) |
| 627 | except NameError: |
| 628 | pass |
| 629 | else: |
| 630 | print("bad should not be defined") |
| 631 | |
| 632 | def x(): |
| 633 | [bad for s in 'a b' for bad in s.split()] |
| 634 | |
| 635 | x() |
| 636 | try: |
| 637 | print(bad) |
| 638 | except NameError: |
| 639 | pass |
| 640 | |
| 641 | def testEvalFreeVars(self): |
| 642 |