From 564f3258ffc46759e6704eecf84e9cfc255709df Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sat, 10 Aug 2019 22:31:41 -0400 Subject: [PATCH] Fix: bt2: replace bt2.CreationError instances with bt2._MemoryError Commit 4acc866e8298 ("bt2: rename CreationError to MemoryError, handle it in and out of Python bindings") removed bt2.CreationError in favor of bt2.MemoryError (now bt2._MemoryError). However, some usages of bt2.CreationError were introduced afterwards, probably by patches that were in the pipeline. Replace them with bt2._MemoryError. Change-Id: Id3cb6542e507b1e41c165ca61df21069d72fb44f Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/1867 Tested-by: jenkins Reviewed-by: Philippe Proulx --- src/bindings/python/bt2/bt2/component.py | 2 +- src/bindings/python/bt2/bt2/interrupter.py | 2 +- src/bindings/python/bt2/bt2/message_iterator.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bindings/python/bt2/bt2/component.py b/src/bindings/python/bt2/bt2/component.py index 72376ef9..49aed23f 100644 --- a/src/bindings/python/bt2/bt2/component.py +++ b/src/bindings/python/bt2/bt2/component.py @@ -872,7 +872,7 @@ class _UserSinkComponent(_UserComponent, _SinkComponent): ) if msg_iter_ptr is None: - raise bt2.CreationError('cannot create message iterator object') + raise bt2._MemoryError('cannot create message iterator object') return bt2_message_iterator._UserComponentInputPortMessageIterator(msg_iter_ptr) diff --git a/src/bindings/python/bt2/bt2/interrupter.py b/src/bindings/python/bt2/bt2/interrupter.py index 9c9868d1..576dc3b9 100644 --- a/src/bindings/python/bt2/bt2/interrupter.py +++ b/src/bindings/python/bt2/bt2/interrupter.py @@ -31,7 +31,7 @@ class Interrupter(object._SharedObject): ptr = native_bt.interrupter_create() if ptr is None: - raise bt2.CreationError('cannot create interrupter object') + raise bt2._MemoryError('cannot create interrupter object') super().__init__(ptr) diff --git a/src/bindings/python/bt2/bt2/message_iterator.py b/src/bindings/python/bt2/bt2/message_iterator.py index 1a48b811..23e2c9a6 100644 --- a/src/bindings/python/bt2/bt2/message_iterator.py +++ b/src/bindings/python/bt2/bt2/message_iterator.py @@ -181,7 +181,7 @@ class _UserMessageIterator(_MessageIterator): ) if msg_iter_ptr is None: - raise bt2.CreationError('cannot create message iterator object') + raise bt2._MemoryError('cannot create message iterator object') return _UserComponentInputPortMessageIterator(msg_iter_ptr) -- 2.34.1