MCPcopy Index your code
hub / github.com/python/cpython / testListCompLocalVars

Method testListCompLocalVars

Lib/test/test_scope.py:623–639  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

xFunction · 0.50

Tested by

no test coverage detected