MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _norm_version

Function _norm_version

tools/python-3.11.9-amd64/Lib/platform.py:235–248  ·  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

233 return lib, version
234
235def _norm_version(version, build=''):
236
237 """ Normalize the version and build strings and return a single
238 version string using the format major.minor.build (or patchlevel).
239 """
240 l = version.split('.')
241 if build:
242 l.append(build)
243 try:
244 strings = list(map(str, map(int, l)))
245 except ValueError:
246 strings = l
247 version = '.'.join(strings[:3])
248 return version
249
250_ver_output = re.compile(r'(?:([\w ]+) ([\w.]+) '
251 r'.*'

Callers 1

_syscmd_verFunction · 0.85

Calls 5

listFunction · 0.85
mapFunction · 0.50
splitMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected