Merge pull request #94 from haosenwang1018/fix/bare-excepts

fix: replace 9 bare excepts with except Exception
This commit is contained in:
夏目侧耳
2026-03-13 21:11:07 +08:00
committed by GitHub
6 changed files with 9 additions and 9 deletions
@@ -210,7 +210,7 @@ class ImportExportService:
if ch.expansion_plan:
try:
expansion_plan = json.loads(ch.expansion_plan) if isinstance(ch.expansion_plan, str) else ch.expansion_plan
except:
except Exception:
expansion_plan = None
exported_chapters.append(ChapterExportData(
@@ -243,7 +243,7 @@ class ImportExportService:
if char.traits:
try:
traits = json.loads(char.traits) if isinstance(char.traits, str) else char.traits
except:
except Exception:
traits = None
exported.append(CharacterExportData(
@@ -1420,7 +1420,7 @@ class ImportExportService:
if char.traits:
try:
traits = json.loads(char.traits) if isinstance(char.traits, str) else char.traits
except:
except Exception:
traits = None
# 基础角色数据
+1 -1
View File
@@ -31,7 +31,7 @@ def clean_json_response(text: str) -> str:
json.loads(text)
logger.debug(f"✅ 直接解析成功,无需清洗")
return text
except:
except Exception:
pass
# 找到第一个 { 或 [