fix: protect os.unlink in finally block from masking original exceptions

This commit is contained in:
2026-04-05 10:38:38 +02:00
parent a2c542a2bc
commit 0ffd624471
+4 -1
View File
@@ -50,7 +50,10 @@ class OmniVoiceGenerate:
kwargs["ref_text"] = ref_text kwargs["ref_text"] = ref_text
audio_tensors = model.generate(**kwargs) audio_tensors = model.generate(**kwargs)
finally: finally:
os.unlink(tmp_path) try:
os.unlink(tmp_path)
except OSError:
pass
elif mode == "voice_design" and instruct: elif mode == "voice_design" and instruct:
kwargs["instruct"] = instruct kwargs["instruct"] = instruct