1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
"""Check for nonlocal and used-before-assignment""" # pylint: disable=missing-docstring, unused-variable __revision__ = 0 def test_ok(): """ uses nonlocal """ cnt = 1 def wrap(): nonlocal cnt cnt = cnt + 1 wrap() def test_fail(): """ doesn't use nonlocal """ cnt = 1 def wrap(): cnt = cnt + 1 wrap()