From f764f6c7e3f108c24b904fe2e41f0fab929734ee Mon Sep 17 00:00:00 2001 From: frxz751113 <156018267+frxz751113@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:50:06 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E9=AA=8C=E6=BA=90.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- py/验源.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/py/验源.py b/py/验源.py index 0d54d15..9becfa6 100644 --- a/py/验源.py +++ b/py/验源.py @@ -102,7 +102,6 @@ try: for line in new_merged_output_lines: f.write(line + '\n') print(f"合并后的文本已保存到文件: {output_file}") -except Exception as e: - continue - # 打印保存文件时的错误信息 - print(f"保存文件时发生错误:{e}") +except SomeSpecificError as e: + print(f"Error processing line '{line}': {e}") + break # 如果出现特定错误,退出循环