fix compile with python >=3