Debug: Add exeception.

results
Pierre-Antoine Rouby 2023-07-04 15:44:27 +02:00
parent 0aeb2f2530
commit 06de6a3a5b
1 changed files with 6 additions and 4 deletions

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))