From c770cc05cffce4cd1fbbabf4ba66b8d4e42dd4e8 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Sat, 5 Jun 2021 15:25:39 +0200 Subject: [PATCH] [Priv Exceptions] added __str__ as __repr__ alias to CpuTrap to correctly format exceptions when printed --- riscemu/priv/Exceptions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/riscemu/priv/Exceptions.py b/riscemu/priv/Exceptions.py index e2b15fe..db3a544 100644 --- a/riscemu/priv/Exceptions.py +++ b/riscemu/priv/Exceptions.py @@ -62,6 +62,9 @@ class CpuTrap(BaseException): name, self.priv.name, self.type.name, self.mtval ) + def __str__(self): + return self.__repr__() + class IllegalInstructionTrap(CpuTrap): def __init__(self, ins: 'ElfInstruction'):