This whole section can be simplified to  `sys.version_info[0]`, it works on all platforms and you can add a comment about how it's equivalent to the major version.