Skip to content

Commit

Permalink
Remove useless warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
definitio committed Aug 29, 2024
1 parent b0022db commit 336eafd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ha-rhvoice-addon/rootfs/opt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def text_prepare(text, stress_marker=False, debug=False):


def voice_streamer(text, voice, format_, sets):
# pylint: disable=used-before-assignment
with tts.say(text, voice, format_, None, sets or None) as read:
for chunk in read:
yield chunk
Expand All @@ -46,7 +47,7 @@ def chunked_stream(stream):


def set_headers():
if CHUNKED_TRANSFER:
if CHUNKED_TRANSFER: # pylint: disable=used-before-assignment
return {"Transfer-Encoding": "chunked", "Connection": "keep-alive"}
return None

Expand All @@ -65,7 +66,7 @@ def say():
format_ = request.args.get("format", DEFAULT_FORMAT)
voice = request.args.get("voice", DEFAULT_VOICE)

if voice not in SUPPORT_VOICES:
if voice not in SUPPORT_VOICES: # pylint: disable=used-before-assignment
return make_response(
f"Unknown voice: '{escape(voice)}'. Support: {', '.join(SUPPORT_VOICES)}.",
400,
Expand Down

0 comments on commit 336eafd

Please sign in to comment.