correct the compatibility between python3 and python2