fork from bitbucket; using 2to3 to support python 3.4