lib: strictly type function return status enumerations
[babeltrace.git] / src / bindings / python / bt2 / bt2 / port.py
index f7c236692e23d35951c00b85375ef58a887d9831..4ba59f066df4c230e4b3ef92389f1ae7b50ad102 100644 (file)
@@ -32,7 +32,7 @@ def _create_from_ptr_and_get_ref(ptr, port_type):
     cls = _PORT_TYPE_TO_PYCLS.get(port_type, None)
 
     if cls is None:
-        raise bt2.Error('unknown port type: {}'.format(port_type))
+        raise TypeError('unknown port type: {}'.format(port_type))
 
     return cls._create_from_ptr_and_get_ref(ptr)
 
@@ -41,7 +41,7 @@ def _create_self_from_ptr_and_get_ref(ptr, port_type):
     cls = _PORT_TYPE_TO_USER_PYCLS.get(port_type, None)
 
     if cls is None:
-        raise bt2.Error('unknown port type: {}'.format(port_type))
+        raise TypeError('unknown port type: {}'.format(port_type))
 
     return cls._create_from_ptr_and_get_ref(ptr)
 
This page took 0.023985 seconds and 4 git commands to generate.