~lttng/babeltrace/trunk

« back to all changes in this revision

Viewing changes to src/bindings/python/bt2/bt2/trace_class.py

  • Committer: Philippe Proulx
  • Author(s): Simon Marchi
  • Date: 2023-09-21 17:29:44 UTC
  • Revision ID: git-v1:c345b07873b0cb0ed344bde32a322a1b1edf60ae
python: remove internal `import bt2` imports

Standardize the internal imports to import specific modules like this:

    from bt2 import foo as bt2_foo

... instead of importing the complete bt2 package.

Change-Id: I32eb223a8bcfe841020a2aafb976f121dadd8680
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10388
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
from bt2 import field_class as bt2_field_class
12
12
from bt2 import integer_range_set as bt2_integer_range_set
13
13
from bt2 import trace as bt2_trace
 
14
from bt2 import error as bt2_error
14
15
from bt2 import value as bt2_value
15
16
import collections.abc
16
17
import functools
17
 
import bt2
18
18
 
19
19
 
20
20
def _trace_class_destruction_listener_from_native(
149
149
        trace_ptr = native_bt.trace_create(self._ptr)
150
150
 
151
151
        if trace_ptr is None:
152
 
            raise bt2._MemoryError("cannot create trace class object")
 
152
            raise bt2_error._MemoryError("cannot create trace class object")
153
153
 
154
154
        trace = bt2_trace._Trace._create_from_ptr(trace_ptr)
155
155
 
281
281
 
282
282
    def _check_field_class_create_status(self, ptr, type_name):
283
283
        if ptr is None:
284
 
            raise bt2._MemoryError("cannot create {} field class".format(type_name))
 
284
            raise bt2_error._MemoryError(
 
285
                "cannot create {} field class".format(type_name)
 
286
            )
285
287
 
286
288
    @staticmethod
287
289
    def _set_field_class_user_attrs(fc, user_attributes):