bt2: prepend underscore to exceptions not meant to be raised by user
[babeltrace.git] / src / bindings / python / bt2 / bt2 / __init__.py.in
index 37c7e4bee1119cc2468c891a1e214ce92a0770a6..8de6ba80d408b346d02697bc80ff76f801ff4859 100644 (file)
@@ -37,12 +37,15 @@ from bt2.component import _UserSinkComponent
 from bt2.component import _UserSourceComponent
 from bt2.connection import *
 from bt2.connection import _Connection
+from bt2.error import *
+from bt2.error import _Error
 from bt2.event import _Event
 from bt2.event_class import *
 from bt2.field_class import *
 from bt2.field_path import *
 from bt2.field import *
 from bt2.graph import *
+from bt2.integer_range_set import *
 from bt2.logging import *
 from bt2.message import *
 from bt2.message import _DiscardedEventsMessage
@@ -66,19 +69,15 @@ from bt2.value import _IntegerValue
 from bt2.clock_snapshot import _UnknownClockSnapshot
 
 
-class Error(Exception):
-    pass
-
-
-class CreationError(Error):
-    '''Raised when object creation fails due to memory issues.'''
+class _MemoryError(_Error):
+    '''Raised when an operation fails due to memory issues.'''
 
 
-class InvalidObject(Error):
+class InvalidObject(Exception):
     pass
 
 
-class InvalidParams(Error):
+class InvalidParams(Exception):
     pass
 
 
@@ -98,7 +97,7 @@ class Stop(StopIteration):
     pass
 
 
-class IncompleteUserClass(Error):
+class IncompleteUserClass(Exception):
     pass
 
 
@@ -106,11 +105,11 @@ class Canceled(Exception):
     pass
 
 
-class NonexistentClockSnapshot(Error):
+class NonexistentClockSnapshot(Exception):
     pass
 
 
-class LoadingError(Error):
+class _LoadingError(_Error):
     pass
 
 
@@ -125,8 +124,12 @@ def _init_and_register_exit():
     import atexit
 
     atexit.register(_native_bt.bt2_cc_exit_handler)
-    version = (_native_bt.version_get_major(), _native_bt.version_get_minor(),
-               _native_bt.version_get_patch(), _native_bt.version_get_extra())
+    version = (
+        _native_bt.version_get_major(),
+        _native_bt.version_get_minor(),
+        _native_bt.version_get_patch(),
+        _native_bt.version_get_extra(),
+    )
     _native_bt.bt2_cc_init_from_bt2()
 
 
This page took 0.030613 seconds and 4 git commands to generate.