Fix: bt2: _EventConst.__getitem__(): check if event has a packet
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 7 Apr 2020 13:41:55 +0000 (09:41 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 8 Apr 2020 17:01:12 +0000 (13:01 -0400)
commit3e05e718fc5631fc24462032aea0e20ec7f090a3
tree66d34961c959d519488a38d1c85385e4321c18d1
parentafdd1f8201f579d81959ce85759dcc62fcc0a85d
Fix: bt2: _EventConst.__getitem__(): check if event has a packet

I'm also adding a test to check this. Without this patch and an invalid
key, __getitem__() throws `AttributeError` instead of the expected
`KeyError`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ie6258a2354ece8aee6c8530587c900ea08e45fe8
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3349
Tested-by: jenkins <jenkins@lttng.org>
src/bindings/python/bt2/bt2/event.py
tests/bindings/python/bt2/test_event.py
This page took 0.026639 seconds and 4 git commands to generate.