From ac681d803012a37fcad647af0ef260dc39e8478d Mon Sep 17 00:00:00 2001 From: MrPandir Date: Thu, 15 Feb 2024 22:01:15 +0100 Subject: [PATCH] refactor: more correct check not from PEP point of view --- tts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tts.py b/tts.py index f7f16cd..bce40ec 100644 --- a/tts.py +++ b/tts.py @@ -33,9 +33,9 @@ def __init__(self): def generate(self, text: str, speaker: str, sample_rate: int) -> bytes: model = self.model_by_speaker.get(speaker) - if model is None: + if not model: raise NotFoundModelException(speaker) - if not sample_rate in self.VALID_SAMPLE_RATES: + if sample_rate not in self.VALID_SAMPLE_RATES: raise InvalidSampleRateException(sample_rate) return self._generate_audio(model, text, speaker, sample_rate)