Python version info should be taken from sys.version_info

Version information should be taken from `sys.version_info` as those are numeric values. The `sys.version` version string is not guaranteed to start with the Python version across Python interpreters.