From 877a43d85e92bc83eb439fc810ec79aeef49ff96 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 Apr 2022 20:42:39 +0530 Subject: [PATCH] ... --- src/calibre/gui2/tts/linux_config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tts/linux_config.py b/src/calibre/gui2/tts/linux_config.py index 1b69f8d2bc..4d5e3e8429 100644 --- a/src/calibre/gui2/tts/linux_config.py +++ b/src/calibre/gui2/tts/linux_config.py @@ -18,7 +18,10 @@ class VoicesModel(QAbstractTableModel): def __init__(self, voice_data, default_output_module, parent=None): super().__init__(parent) self.voice_data = voice_data - self.current_voices = voice_data[default_output_module] + try: + self.current_voices = voice_data[default_output_module] + except KeyError as e: + raise ValueError(_('Speech dispatcher on this system is not configured with any available voices. Install some voices first.')) from e self.column_headers = (_('Name'), _('Language'), _('Variant')) def rowCount(self, parent=None):