Use sys.version_info to determine Python version

The string `sys.version` should not be used to determine Python version as there's no guarantee the version number will be at the beginning of the string.