bt2: Sync native_bt_field_class.i with field-class-const.h
[babeltrace.git] / bindings / python / bt2 / bt2 / __init__.py.in
index 554391ecf7e26b244dc8e6282db89e301afb8662..dffc7f21f92d9ea831056df0027ea1fb289ee4c5 100644 (file)
@@ -93,10 +93,6 @@ class Frozen(Error):
     pass
 
 
-class NoSuchPlugin(Error):
-    pass
-
-
 class InvalidQueryObject(Error):
     pass
 
@@ -155,14 +151,18 @@ class _ListenerHandle:
         self._obj = obj
 
 
-import bt2.native_bt as _native_bt
-import atexit
+def _init_and_register_exit():
+    import bt2.native_bt as _native_bt
+    import atexit
+
+    atexit.register(_native_bt.py3_cc_exit_handler)
+    version = (_native_bt.version_get_major(), _native_bt.version_get_minor(),
+               _native_bt.version_get_patch(), _native_bt.version_get_extra())
+    _native_bt.py3_cc_init_from_bt2()
+
+
+_init_and_register_exit()
 
-atexit.register(_native_bt.py3_cc_exit_handler)
-version = (_native_bt.version_get_major(), _native_bt.version_get_minor(),
-           _native_bt.version_get_patch(), _native_bt.version_get_extra())
-_native_bt.py3_cc_init_from_bt2()
-del _native_bt
 
 try:
     del native_bt
This page took 0.03644 seconds and 4 git commands to generate.