compatible to python3.x