summaryrefslogtreecommitdiffstats
path: root/polymatrix/utils/tooperatorexception.py
diff options
context:
space:
mode:
authorMichael Schneeberger <michael.schneeberger@fhnw.ch>2024-03-27 14:52:22 +0100
committerMichael Schneeberger <michael.schneeberger@fhnw.ch>2024-03-27 14:52:22 +0100
commitebc557009b5343be74d1ef8e3a9e1c9b44d24a8f (patch)
treec1e6c67fb86e7afd864b3188db6829a463b47aba /polymatrix/utils/tooperatorexception.py
parentadd minimal documentation to the expression mixins (diff)
downloadpolymatrix-ebc557009b5343be74d1ef8e3a9e1c9b44d24a8f.tar.gz
polymatrix-ebc557009b5343be74d1ef8e3a9e1c9b44d24a8f.zip
format Python files with ruff
Diffstat (limited to 'polymatrix/utils/tooperatorexception.py')
-rw-r--r--polymatrix/utils/tooperatorexception.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/polymatrix/utils/tooperatorexception.py b/polymatrix/utils/tooperatorexception.py
index 5f7db0f..1c84be7 100644
--- a/polymatrix/utils/tooperatorexception.py
+++ b/polymatrix/utils/tooperatorexception.py
@@ -2,13 +2,16 @@ from polymatrix.utils.getstacklines import FrameSummary
def to_operator_exception(
- message: str,
- stack: tuple[FrameSummary],
+ message: str,
+ stack: tuple[FrameSummary],
) -> str:
exception_lines = [
message,
- f' Assertion traceback (most recent call last):',
- *(f' File "{stack_line.filename}", line {stack_line.lineno}\n {stack_line.line}' for stack_line in stack),
+ f" Assertion traceback (most recent call last):",
+ *(
+ f' File "{stack_line.filename}", line {stack_line.lineno}\n {stack_line.line}'
+ for stack_line in stack
+ ),
]
- return '\n'.join(exception_lines)
+ return "\n".join(exception_lines)