Commit 06de6a3a authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Debug: Add exeception.

parent 0aeb2f25
No related merge requests found
Showing with 6 additions and 4 deletions
+6 -4
...@@ -70,12 +70,14 @@ class ReplWindow(ASubMainWindow, ListedSubWindow): ...@@ -70,12 +70,14 @@ class ReplWindow(ASubMainWindow, ListedSubWindow):
self.set_line_edit_text("lineEdit", "") self.set_line_edit_text("lineEdit", "")
self._history_ind = 0 self._history_ind = 0
code = "self.__debug_exec_result__ = " + code rich_code = "self.__debug_exec_result__ = " + code
print(f"[DEBUG] ! {code}") print(f"[DEBUG] ! {code}")
value = exec(code) try:
value = self.__debug_exec_result__ 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>" msg = f"<font color=\"grey\"> # " + code + " #</font>"
self.find(QTextEdit, "textEdit").append(msg) self.find(QTextEdit, "textEdit").append(msg)
self.find(QTextEdit, "textEdit").append(str(value)) self.find(QTextEdit, "textEdit").append(str(value))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment