clean some code
fix PY_MAIN_VERSION