Skip to content

Commit 2fa949a

Browse files
committed
refactor: deduplicate Firefox tag regex in firefox_version.py
1 parent 401ce3f commit 2fa949a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/firefox_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222

2323
INSTALL_SCRIPT = Path(__file__).resolve().parent / "install-firefox.sh"
2424
TAGS_URL = "https://hg.mozilla.org/releases/mozilla-release/json-tags"
25-
_TAG_RE = re.compile(r"FIREFOX_\d+_\d+(?:_\d+)?_RELEASE")
25+
_TAG_RE = re.compile(r"FIREFOX_(\d+)_(\d+)(?:_(\d+))?_RELEASE")
2626

2727

2828
def _version_key(tag: str) -> tuple[int, int, int]:
29-
m = re.fullmatch(r"FIREFOX_(\d+)_(\d+)(?:_(\d+))?_RELEASE", tag)
29+
m = _TAG_RE.fullmatch(tag)
3030
if not m:
3131
return (0, 0, 0)
3232
return (int(m.group(1)), int(m.group(2)), int(m.group(3) or 0))

0 commit comments

Comments
 (0)