python: run isort on everything
[babeltrace.git] / src / bindings / python / bt2 / bt2 / error.py
index a067345187c3a646d35f1dc5eda93ebc66ce2b33..b6d0e9e11edbbcf8eadd9e024f6ab8e1520dec67 100644 (file)
@@ -2,9 +2,10 @@
 #
 # Copyright (c) 2019 Simon Marchi <simon.marchi@efficios.com>
 
-from bt2 import native_bt
 from collections import abc
 
+from bt2 import native_bt
+
 
 class ComponentClassType:
     SOURCE = native_bt.COMPONENT_CLASS_TYPE_SOURCE
@@ -13,9 +14,9 @@ class ComponentClassType:
 
 
 _COMPONENT_CLASS_TYPE_TO_STR = {
-    native_bt.COMPONENT_CLASS_TYPE_SOURCE: 'source',
-    native_bt.COMPONENT_CLASS_TYPE_FILTER: 'filter',
-    native_bt.COMPONENT_CLASS_TYPE_SINK: 'sink',
+    native_bt.COMPONENT_CLASS_TYPE_SOURCE: "source",
+    native_bt.COMPONENT_CLASS_TYPE_FILTER: "filter",
+    native_bt.COMPONENT_CLASS_TYPE_SINK: "sink",
 }
 
 
@@ -174,7 +175,7 @@ class _Error(Exception, abc.Sequence):
         assert self._ptr is not None
 
         self._msg = msg
-        self._str = msg + '\n' + native_bt.bt2_format_bt_error(self._ptr)
+        self._str = msg + "\n" + native_bt.bt2_format_bt_error(self._ptr)
 
         # Read everything we might need from the error pointer, so we don't
         # depend on it.  It's possible for the user to keep an Error object
@@ -219,3 +220,7 @@ class _Error(Exception, abc.Sequence):
 
     def __str__(self):
         return self._str
+
+
+class _MemoryError(_Error):
+    """Raised when an operation fails due to memory issues."""
This page took 0.104421 seconds and 4 git commands to generate.