Final code quality improvements: fix error handling and memory management

Co-authored-by: mblanke <9078342+mblanke@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-03 13:00:34 +00:00
parent d0aadefad9
commit 4e3cf99e04
4 changed files with 21 additions and 5 deletions

View File

@@ -91,8 +91,8 @@ def _transcribe_with_local_whisper(audio_data: bytes, format: str) -> Dict[str,
# Clean up temp file
try:
os.unlink(temp_audio_path)
except:
pass
except (OSError, FileNotFoundError) as e:
print(f"Warning: Could not delete temp file: {e}")
except ImportError:
raise Exception("Whisper not installed. Install with: pip install openai-whisper")