Added `nonlocal` keyword for python3