Python3.x compatibility fix