fix generate script support for python 3
regen (now with python 3) - sequence of enum and exts in types is swapped but works either way