Skip to content

Commit d49563a

Browse files
committed
fix: add try..except clause
1 parent ed69e35 commit d49563a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
content = content.replace("[中文文档](/solution/CONTEST_README.md)", "")
1212
res = re.findall(r"\[(.*?)\]\((.*?)\)", content)
1313
for _, link in res:
14-
num = link.split("/")[-2].split(".")[0]
15-
num = int(num)
16-
content = content.replace(link, f"./lc/{num}.md")
14+
try:
15+
num = link.split("/")[-2].split(".")[0]
16+
num = int(num)
17+
content = content.replace(link, f"./lc/{num}.md")
18+
except:
19+
pass
1720
content = f"---\ncomments: true\n---\n\n" + content
1821

1922
with open(contest_file, "w", encoding="utf-8") as f:

0 commit comments

Comments
 (0)