Rename version parts binding for clarity.

The “version info” meaning already conventionally means the tuple of
version components, like ‘sys.version_info’. Rename the mapping to avoid
this meaning.
This commit is contained in:
Ben Finney 2016-10-19 00:00:21 +11:00
parent 98e83c4361
commit 94b478badf

View File

@ -28,13 +28,13 @@ def parse(version):
if match is None: if match is None:
raise ValueError('%s is not valid SemVer string' % version) raise ValueError('%s is not valid SemVer string' % version)
verinfo = match.groupdict() version_parts = match.groupdict()
verinfo['major'] = int(verinfo['major']) version_parts['major'] = int(version_parts['major'])
verinfo['minor'] = int(verinfo['minor']) version_parts['minor'] = int(version_parts['minor'])
verinfo['patch'] = int(verinfo['patch']) version_parts['patch'] = int(version_parts['patch'])
return verinfo return version_parts
def compare(ver1, ver2): def compare(ver1, ver2):