bt2: make bt2.Error wrap current thread's error
[babeltrace.git] / src / bindings / python / bt2 / bt2 / __init__.py.in
index 1e5b8ee38c848c5081260361df6f7bd0bcbd9d62..ba17f1bed030ef01e8d445c44ed132fa0ca896bc 100644 (file)
@@ -37,6 +37,7 @@ 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.event import _Event
 from bt2.event_class import *
 from bt2.field_class import *
@@ -67,19 +68,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 InvalidObject(Error):
+class InvalidObject(Exception):
     pass
 
 
-class InvalidParams(Error):
+class InvalidParams(Exception):
     pass
 
 
@@ -99,7 +96,7 @@ class Stop(StopIteration):
     pass
 
 
-class IncompleteUserClass(Error):
+class IncompleteUserClass(Exception):
     pass
 
 
@@ -107,7 +104,7 @@ class Canceled(Exception):
     pass
 
 
-class NonexistentClockSnapshot(Error):
+class NonexistentClockSnapshot(Exception):
     pass
 
 
@@ -126,8 +123,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.024611 seconds and 4 git commands to generate.