Debug: Add exeception.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-07-04 15:47:56 +02:00
1 parent 0aeb2f2530
commit 06de6a3a5b
1 file changed
+6 -4
+6 -4
View File
@@ -70,12 +70,14 @@ class ReplWindow(ASubMainWindow, ListedSubWindow):
self.set_line_edit_text("lineEdit", "")
self._history_ind = 0
code = "self.__debug_exec_result__ = " + code
rich_code = "self.__debug_exec_result__ = " + code
print(f"[DEBUG] ! {code}")
value = exec(code)
value = self.__debug_exec_result__
try:
value = exec(rich_code)
value = self.__debug_exec_result__
except Exception as e:
value = f"<font color=\"red\">" + str(e) + "</font>"
msg = f"<font color=\"grey\"> # " + code + " #</font>"
self.find(QTextEdit, "textEdit").append(msg)
self.find(QTextEdit, "textEdit").append(str(value))