Pyright says:
/home/smarchi/src/babeltrace/src/bindings/python/bt2/bt2/utils.py:160:19 - error: Invalid exception class or object
Constructor for exception type "type[_OverflowError]" requires one or more arguments (reportGeneralTypeIssues)
That's true, _OverflowError has bt2_error._Error as a base, which
requires a message. Change _handle_func_status to assert that a msg was
provided when handling that case.
Change-Id: I961c336cf53ce13e5f4241728e1131cccb77efcf
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11297
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
else:
raise TryAgain(msg)
elif status == native_bt.__BT_FUNC_STATUS_OVERFLOW_ERROR:
else:
raise TryAgain(msg)
elif status == native_bt.__BT_FUNC_STATUS_OVERFLOW_ERROR:
- if msg is None:
- raise _OverflowError
- else:
- raise _OverflowError(msg)
+ raise _OverflowError(msg)
elif status == native_bt.__BT_FUNC_STATUS_UNKNOWN_OBJECT:
if msg is None:
raise UnknownObject
elif status == native_bt.__BT_FUNC_STATUS_UNKNOWN_OBJECT:
if msg is None:
raise UnknownObject