Preliminary compatibility with python3