Fix: _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:04:40 +0000 (13:04 -0400)
commit37b9f25d286144143f92539469ebed1bb64ae878
tree41c836b4d343c4ea6a4c89637db38a97244ed6b0
parent11cbb0e6e35843d89de8c5c072480d3cf77cc05a
Fix: _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/+/3350
Tested-by: jenkins <jenkins@lttng.org>
src/bindings/python/bt2/bt2/event.py
tests/bindings/python/bt2/test_event.py
This page took 0.026666 seconds and 4 git commands to generate.