Fix Python version detection for Python 2.6