mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-31 07:05:24 +08:00
Add a comment about _typeshed to VERSIONS (#5447)
This commit is contained in:
@@ -107,7 +107,8 @@ def check_versions():
|
||||
with open("stdlib/VERSIONS") as f:
|
||||
data = f.read().splitlines()
|
||||
for line in data:
|
||||
if not line or line.lstrip().startswith("#"):
|
||||
line = line.split("#")[0].strip()
|
||||
if line == "":
|
||||
continue
|
||||
m = _VERSIONS_RE.match(line)
|
||||
if not m:
|
||||
|
||||
@@ -75,19 +75,19 @@ _VERSION_LINE_RE = re.compile(r"^([a-zA-Z_][a-zA-Z0-9_.]*): ([23]\.\d{1,2})-([23
|
||||
|
||||
|
||||
def parse_versions(fname):
|
||||
with open(fname) as f:
|
||||
data = f.read().splitlines()
|
||||
result = {}
|
||||
for line in data:
|
||||
# Allow having some comments or empty lines.
|
||||
if not line.strip() or line.startswith("#"):
|
||||
continue
|
||||
m = _VERSION_LINE_RE.match(line)
|
||||
assert m, "invalid VERSIONS line :" + line
|
||||
mod = m.group(1)
|
||||
min_version = parse_version(m.group(2))
|
||||
max_version = parse_version(m.group(3)) if m.group(3) else (99, 99)
|
||||
result[mod] = min_version, max_version
|
||||
with open(fname) as f:
|
||||
for line in f:
|
||||
# Allow having some comments or empty lines.
|
||||
line = line.split("#")[0].strip()
|
||||
if line == "":
|
||||
continue
|
||||
m = _VERSION_LINE_RE.match(line)
|
||||
assert m, "invalid VERSIONS line: " + line
|
||||
mod = m.group(1)
|
||||
min_version = parse_version(m.group(2))
|
||||
max_version = parse_version(m.group(3)) if m.group(3) else (99, 99)
|
||||
result[mod] = min_version, max_version
|
||||
return result
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ _VERSION_RE = re.compile(r"^([23])\.(\d+)$")
|
||||
|
||||
def parse_version(v_str):
|
||||
m = _VERSION_RE.match(v_str)
|
||||
assert m, "invalid version :" + v_str
|
||||
assert m, "invalid version: " + v_str
|
||||
return int(m.group(1)), int(m.group(2))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user