Fix typechecking error on Windows

This commit is contained in:
Damien Elmes 2022-11-29 13:21:48 +10:00
parent a70f8d4dd5
commit 65b8b8c69b

View file

@ -555,7 +555,7 @@ if is_win:
import winsdk.windows.media.speechsynthesis as speechsynthesis # type: ignore
try:
self.voice_list = speechsynthesis.SpeechSynthesizer.get_all_voices()
self.voice_list = speechsynthesis.SpeechSynthesizer.get_all_voices() # type: ignore
except Exception as e:
print("winsdk tts voices unavailable:", e)
self.voice_list = []
@ -605,7 +605,7 @@ if is_win:
synthesizer = speechsynthesis.SpeechSynthesizer()
voices = speechsynthesis.SpeechSynthesizer.get_all_voices()
voices = speechsynthesis.SpeechSynthesizer.get_all_voices() # type: ignore
voice_match = next(filter(lambda v: v.id == voice_id, voices))
assert voice_match