Fix python mode locals