bt2: prepend underscore to exceptions not meant to be raised by user
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 24 Jul 2019 01:56:58 +0000 (21:56 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 24 Jul 2019 04:18:54 +0000 (00:18 -0400)
commit694c792bc8f078c02acde68a3390acafbb36b2f4
treefbc17470e7012829d43c377cdeebeb5cc9314073
parent4acc866e829881299a13d0aa8e28b93807549975
bt2: prepend underscore to exceptions not meant to be raised by user

The exceptions Error, MemoryError and LoadingError are only meant to be
raised by the Python bindings, in response to corresponding status codes
from the Babeltrace API.  As per our convention, names of classes not
meant to be instantiated directly by the user are prepended with an
underscore, so change these accordingly.

Note that they are still accessible to the user if they need to catch
an exception:

    try:
        ...
    except bt2._Error:
        ...

Change-Id: If094d817dac3c507b6bf3e1e794373f1c7fc33e4
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1752
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
20 files changed:
src/bindings/python/bt2/bt2/__init__.py.in
src/bindings/python/bt2/bt2/component.py
src/bindings/python/bt2/bt2/error.py
src/bindings/python/bt2/bt2/field_class.py
src/bindings/python/bt2/bt2/graph.py
src/bindings/python/bt2/bt2/integer_range_set.py
src/bindings/python/bt2/bt2/message_iterator.py
src/bindings/python/bt2/bt2/native_bt_component_class.i
src/bindings/python/bt2/bt2/port.py
src/bindings/python/bt2/bt2/query_executor.py
src/bindings/python/bt2/bt2/stream.py
src/bindings/python/bt2/bt2/trace.py
src/bindings/python/bt2/bt2/trace_class.py
src/bindings/python/bt2/bt2/utils.py
src/bindings/python/bt2/bt2/value.py
tests/bindings/python/bt2/test_component_class.py
tests/bindings/python/bt2/test_error.py
tests/bindings/python/bt2/test_graph.py
tests/bindings/python/bt2/test_message_iterator.py
tests/bindings/python/bt2/test_query_executor.py
This page took 0.027119 seconds and 4 git commands to generate.