Skip to content

Commit 6f866b8

Browse files
Use raw strings for regex
1 parent b1b3051 commit 6f866b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

update.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def find_latest_version() -> str:
204204
assert vfile is not None, "version file is not a regular file"
205205
version = vfile.read().decode("utf-8").strip()
206206

207-
assert re.match("\d{4}[a-z]$", version), version
207+
assert re.match(r"\d{4}[a-z]$", version), version
208208

209209
target_dir = WORKING_DIR / version / "download"
210210
target_dir.mkdir(parents=True, exist_ok=True)
@@ -375,7 +375,7 @@ def parse_categories(news_block: Sequence[str]) -> Mapping[str, str]:
375375

376376

377377
def read_news(tzdb_loc: pathlib.Path, version: str | None = None) -> NewsEntry:
378-
release_re = re.compile("^Release (?P<version>\d{4}[a-z]) - (?P<date>.*$)")
378+
release_re = re.compile(r"^Release (?P<version>\d{4}[a-z]) - (?P<date>.*$)")
379379
with open(tzdb_loc / "NEWS", "rt") as f:
380380
f_lines = map(str.rstrip, f)
381381
for line in f_lines:

0 commit comments

Comments
 (0)