:improve: compatibility with python 2.6, 2.7 and 3.x