fix some bug about python2 support