How to declare nonlocal dynamically in closures

my purpose is to declare dynamically, either b or c

def t1():
    b = 1
    c = 2
    def t2():
       s = "nonlocal "+ "b"
       exec(s)

will make an error SyntaxError: nonlocal declaration not allowed at module level
is there a solution

Sep.17,2021
Menu