bt2: value.py: _IntegerValue._value_to_int(): require `numbers.Integral`
Be more strict in _IntegerValue._value_to_int(): require that the
parameter's type is an instance of `numbers.Integral` instead of
`numbers.Real` to make the following raise a type error:
bt2.UnsignedIntegerValue(17.5)
and
a = bt2.UnsignedIntegerValue()
a.value = 17.5
I believe it's better to be strict here than to arbitrarily choose to
use the parameter's value's floor.
BoolValue._value_to_bool() and RealValue._value_to_float() already
require resp. a boolean value and a real value, so this is just
analogous.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I374baf8c5d69400b687daabea873598eb2543a47
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1567
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
This page took 0.026095 seconds and 4 git commands to generate.