From 3f73fe102148e3cdaf7c725433b9d448164dd43d Mon Sep 17 00:00:00 2001 From: tarepan Date: Wed, 29 May 2024 05:12:42 +0000 Subject: [PATCH 1/2] =?UTF-8?q?remove:=20HTTP=20=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=81=A8=E9=87=8D=E8=A4=87=E3=81=99=E3=82=8B=20`print?= =?UTF-8?q?=5Fexc()`=20=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- voicevox_engine/app/routers/speaker.py | 2 -- voicevox_engine/app/routers/user_dict.py | 5 ----- voicevox_engine/user_dict/user_dict.py | 1 - 3 files changed, 8 deletions(-) diff --git a/voicevox_engine/app/routers/speaker.py b/voicevox_engine/app/routers/speaker.py index 60b9dbda0..aa46b186b 100644 --- a/voicevox_engine/app/routers/speaker.py +++ b/voicevox_engine/app/routers/speaker.py @@ -2,7 +2,6 @@ import base64 import json -import traceback from pathlib import Path from typing import Annotated, Literal @@ -127,7 +126,6 @@ def _speaker_info( } ) except FileNotFoundError: - traceback.print_exc() msg = "追加情報が見つかりませんでした" raise HTTPException(status_code=500, detail=msg) diff --git a/voicevox_engine/app/routers/user_dict.py b/voicevox_engine/app/routers/user_dict.py index 54073d541..63051079e 100644 --- a/voicevox_engine/app/routers/user_dict.py +++ b/voicevox_engine/app/routers/user_dict.py @@ -31,7 +31,6 @@ def get_user_dict_words() -> dict[str, UserDictWord]: except UserDictInputError as err: raise HTTPException(status_code=422, detail=str(err)) except Exception: - traceback.print_exc() raise HTTPException( status_code=500, detail="辞書の読み込みに失敗しました。" ) @@ -77,7 +76,6 @@ def add_user_dict_word( except UserDictInputError as err: raise HTTPException(status_code=422, detail=str(err)) except Exception: - traceback.print_exc() raise HTTPException( status_code=500, detail="ユーザー辞書への追加に失敗しました。" ) @@ -128,7 +126,6 @@ def rewrite_user_dict_word( except UserDictInputError as err: raise HTTPException(status_code=422, detail=str(err)) except Exception: - traceback.print_exc() raise HTTPException( status_code=500, detail="ユーザー辞書の更新に失敗しました。" ) @@ -149,7 +146,6 @@ def delete_user_dict_word( except UserDictInputError as err: raise HTTPException(status_code=422, detail=str(err)) except Exception: - traceback.print_exc() raise HTTPException( status_code=500, detail="ユーザー辞書の更新に失敗しました。" ) @@ -176,7 +172,6 @@ def import_user_dict_words( except UserDictInputError as err: raise HTTPException(status_code=422, detail=str(err)) except Exception: - traceback.print_exc() raise HTTPException( status_code=500, detail="ユーザー辞書のインポートに失敗しました。" ) diff --git a/voicevox_engine/user_dict/user_dict.py b/voicevox_engine/user_dict/user_dict.py index 0cd01043f..56cda910e 100644 --- a/voicevox_engine/user_dict/user_dict.py +++ b/voicevox_engine/user_dict/user_dict.py @@ -159,7 +159,6 @@ def _update_dict( except Exception as e: print("Error: Failed to update dictionary.", file=sys.stderr) - traceback.print_exc(file=sys.stderr) raise e finally: From c917c91528df6211d8eaa33c6cff3f97bffb13ca Mon Sep 17 00:00:00 2001 From: tarepan Date: Wed, 29 May 2024 05:13:40 +0000 Subject: [PATCH 2/2] fix: lint --- voicevox_engine/app/routers/user_dict.py | 1 - voicevox_engine/user_dict/user_dict.py | 1 - 2 files changed, 2 deletions(-) diff --git a/voicevox_engine/app/routers/user_dict.py b/voicevox_engine/app/routers/user_dict.py index 63051079e..365176c4b 100644 --- a/voicevox_engine/app/routers/user_dict.py +++ b/voicevox_engine/app/routers/user_dict.py @@ -1,6 +1,5 @@ """ユーザー辞書機能を提供する API Router""" -import traceback from typing import Annotated from fastapi import APIRouter, Body, Depends, HTTPException, Path, Query diff --git a/voicevox_engine/user_dict/user_dict.py b/voicevox_engine/user_dict/user_dict.py index 56cda910e..5cad3ebe1 100644 --- a/voicevox_engine/user_dict/user_dict.py +++ b/voicevox_engine/user_dict/user_dict.py @@ -1,7 +1,6 @@ import json import sys import threading -import traceback from collections.abc import Callable from pathlib import Path from typing import Any, Final, TypeVar