diff options
| author | Scott <[email protected]> | 2022-01-11 13:33:24 -0800 |
|---|---|---|
| committer | Scott <[email protected]> | 2022-01-11 13:33:24 -0800 |
| commit | b454ad295eb3024a238d32bf2aef1ebc3c496b44 (patch) | |
| tree | 89368a7cdad571da9e2c7297190fdce48eb3feb9 /google_assistant.py | |
| parent | d2478310649d51e14f8ece57651ca9d925d98793 (diff) | |
Start using warnings from stdlib.
Diffstat (limited to 'google_assistant.py')
| -rw-r--r-- | google_assistant.py | 5 |
1 files changed, 4 insertions, 1 deletions
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, |
