diff --git a/adafruit_rtttl.py b/adafruit_rtttl.py index c2087be..848be44 100644 --- a/adafruit_rtttl.py +++ b/adafruit_rtttl.py @@ -19,17 +19,21 @@ import pwmio AUDIOIO_AVAILABLE = False +WAVEFORM_AVAILABLE = False try: import audioio - from adafruit_waveform import sine AUDIOIO_AVAILABLE = True + from adafruit_waveform import sine + + WAVEFORM_AVAILABLE = True try: import audiocore except ImportError: audiocore = audioio -except ImportError: - pass +except ImportError as e: + if not WAVEFORM_AVAILABLE: + raise e try: from typing import Optional, Union, Tuple, List diff --git a/docs/conf.py b/docs/conf.py index 7b280e5..954bde4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,7 @@ "sphinx.ext.viewcode", ] -autodoc_mock_imports = ["pulseio", "pwmio", "audioio"] +autodoc_mock_imports = ["pulseio", "pwmio", "audioio", "adafruit_waveform"] intersphinx_mapping = { "python": ("https://docs.python.org/3.4", None),