rewrite py2exe_util.c with pure python