From 91dd81073d09fe697a636ce81b7bf32772150812 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 3 Sep 2026 19:52:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20voices.py=20?= =?UTF-8?q?=E4=B8=AD=203=20=E5=A4=84=20ruff=20B904=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=EF=BC=88raise=20without=20from=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/app/api/routes/voices.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/api/app/api/routes/voices.py b/apps/api/app/api/routes/voices.py index b61103113..c6d36ac1f 100755 --- a/apps/api/app/api/routes/voices.py +++ b/apps/api/app/api/routes/voices.py @@ -687,13 +687,13 @@ def extract_voice_from_video( raise HTTPException( status_code=status.HTTP_504_GATEWAY_TIMEOUT, detail="视频处理超时,请尝试较短的视频", - ) + ) from None except Exception as e: logger.exception("提取视频配音失败: %s", e) raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail="提取配音失败,请稍后重试", - ) + ) from e finally: # 清理临时文件 if tmp_dir and Path(tmp_dir).exists(): @@ -740,7 +740,7 @@ def _find_or_create_voice_library_for_extract(*, user_id, project_repository, as raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail="配音素材库创建失败", - ) + ) from None def _get_audio_duration(audio_path: Path) -> float: -- 2.54.0