I think here it would be much easier to use `sys.version_info[0]` (that's already an integer)