MCPcopy Index your code
hub / github.com/python/cpython / _norm_version

Function _norm_version

Lib/platform.py:256–269  ·  view source on GitHub ↗

Normalize the version and build strings and return a single version string using the format major.minor.build (or patchlevel).

(version, build='')

Source from the content-addressed store, hash-verified

254 return lib, version if ver is None else ver
255
256def _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:

Callers 1

_syscmd_verFunction · 0.85

Calls 4

listClass · 0.85
splitMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…