#this code runs. Delete the `nonlocal x`, and it crashes.
def a():
    x = 1
    def b():
        nonlocal x
        eval("x")
    b()
a()