Normalize the version and build strings and return a single version string using the format major.minor.build (or patchlevel).
(version, build='')
| 254 | return lib, version if ver is None else ver |
| 255 | |
| 256 | def _norm_version(version, build=''): |
| 257 | |
| 258 | """ Normalize the version and build strings and return a single |
| 259 | version string using the format major.minor.build (or patchlevel). |
| 260 | """ |
| 261 | l = version.split('.') |
| 262 | if build: |
| 263 | l.append(build) |
| 264 | try: |
| 265 | strings = list(map(str, map(int, l))) |
| 266 | except ValueError: |
| 267 | strings = l |
| 268 | version = '.'.join(strings[:3]) |
| 269 | return version |
| 270 | |
| 271 | |
| 272 | # Examples of VER command output: |
no test coverage detected
searching dependent graphs…