Skip to content

Commit

Permalink
typeshed: fix version parsing regex (#1001)
Browse files Browse the repository at this point in the history
Fails for e.g. `binhex: 2.7-3.10`

Resolves #1001

PiperOrigin-RevId: 395326732
  • Loading branch information
hauntsaninja authored and rchen152 committed Sep 7, 2021
1 parent 0e24922 commit 7e19fdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytype/pytd/typeshed.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _load_stdlib_versions(self):
line2 = line.split("#")[0].strip()
if not line2:
continue
match = re.fullmatch(r"(.+): (\d)\.(\d+)(?:-(?:(\d)\.(\d))?)?", line2)
match = re.fullmatch(r"(.+): (\d)\.(\d+)(?:-(?:(\d)\.(\d+))?)?", line2)
assert match
module, min_major, min_minor, max_major, max_minor = match.groups()
minimum = (int(min_major), int(min_minor))
Expand Down

0 comments on commit 7e19fdb

Please sign in to comment.