From b454ad295eb3024a238d32bf2aef1ebc3c496b44 Mon Sep 17 00:00:00 2001 From: Scott Date: Tue, 11 Jan 2022 13:33:24 -0800 Subject: Start using warnings from stdlib. --- google_assistant.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'google_assistant.py') diff --git a/google_assistant.py b/google_assistant.py index 572b4cc..041648c 100644 --- a/google_assistant.py +++ b/google_assistant.py @@ -3,6 +3,7 @@ import logging from typing import NamedTuple import sys +import warnings import requests import speech_recognition as sr # type: ignore @@ -93,7 +94,9 @@ def ask_google(cmd: str, *, recognize_speech=True) -> GoogleResponse: logger.debug(f"Transcription: '{audio_transcription}'") except sr.UnknownValueError as e: logger.exception(e) - logger.warning('Unable to parse Google assistant\'s response.') + msg = 'Unable to parse Google assistant\'s response.' + logger.warning(msg) + warnings.warn(msg) audio_transcription = None return GoogleResponse( success=success, -- cgit v1.3