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
+3
View File
@@ -50,7 +50,10 @@ class OmniVoiceGenerate:
kwargs["ref_text"] = ref_text
audio_tensors = model.generate(**kwargs)
finally:
try:
os.unlink(tmp_path)
except OSError:
pass
elif mode == "voice_design" and instruct:
kwargs["instruct"] = instruct