Raise RuntimeError instead of printing warning if lttng module not found

This commit is contained in:
Christophe Bedard 2020-01-09 19:53:09 -05:00
parent 69ba4eadc4
commit 1366f709e1
2 changed files with 7 additions and 5 deletions

View file

@ -25,7 +25,6 @@ try:
_lttng = lttng_impl _lttng = lttng_impl
except ImportError: except ImportError:
# Fall back on empty functions # Fall back on empty functions
print('Warning: lttng Python package not found', file=sys.stderr)
from . import lttng_stub from . import lttng_stub
_lttng = lttng_stub _lttng = lttng_stub

View file

@ -15,17 +15,20 @@
"""Stub version of the interface for tracing with LTTng.""" """Stub version of the interface for tracing with LTTng."""
ERROR_MESSAGE = 'lttng Python module not found'
def setup(*args, **kwargs) -> None: def setup(*args, **kwargs) -> None:
pass raise RuntimeError(ERROR_MESSAGE)
def start(*args, **kwargs) -> None: def start(*args, **kwargs) -> None:
pass raise RuntimeError(ERROR_MESSAGE)
def stop(*args, **kwargs) -> None: def stop(*args, **kwargs) -> None:
pass raise RuntimeError(ERROR_MESSAGE)
def destroy(*args, **kwargs) -> None: def destroy(*args, **kwargs) -> None:
pass raise RuntimeError(ERROR_MESSAGE)