Fix Python version detection for version 3.4+

Python 3.4+ reports the version number differently.
(http://bugs.python.org/issue18338)