pass sort to cProfile if python 2.7, otherwise revert