From 68e3b16003a76c8907be678d5e1d1709025ff13e Mon Sep 17 00:00:00 2001 From: sabonerune <102559104+sabonerune@users.noreply.github.com> Date: Wed, 15 Jan 2025 22:36:55 +0900 Subject: [PATCH] =?UTF-8?q?FIX:=20=E4=BE=8B=E5=A4=96=E3=81=AE=E6=83=85?= =?UTF-8?q?=E5=A0=B1=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- voicevox_engine/user_dict/user_dict_manager.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/voicevox_engine/user_dict/user_dict_manager.py b/voicevox_engine/user_dict/user_dict_manager.py index acfb02196..84e013a1c 100644 --- a/voicevox_engine/user_dict/user_dict_manager.py +++ b/voicevox_engine/user_dict/user_dict_manager.py @@ -103,11 +103,15 @@ def _delete_file_on_close(file_path: Path) -> None: None, ) if h_file == _INVALID_HANDLE_VALUE: - raise RuntimeError(f"Failed to CreateFileW for {file_path}") + raise RuntimeError( + f"Failed to CreateFileW for {file_path}" + ) from ctypes.WinError() result = _CloseHandle(h_file) if result == 0: - raise RuntimeError(f"Failed to CloseHandle for {file_path}") + raise RuntimeError( + f"Failed to CloseHandle for {file_path}" + ) from ctypes.WinError() else: file_path.unlink()