[Lldb-commits] [lldb] [lldb/Interpreter] Propagate `script` output back to command return object (PR #109440)
    Jonas Devlieghere via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Fri Sep 20 10:42:12 PDT 2024
    
    
  
================
@@ -116,19 +118,50 @@ def run_python_interpreter(local_dict):
             print("Script exited with code %s" % e.code)
 
 
+class LLDBInteractiveConsole(code.InteractiveConsole):
+    def __init__(self, locals=None):
+        super().__init__(locals)
+        self.result_output = None
+
+    ### Implementation detail:
+    ### https://docs.python.org/3/library/code.html#code.InteractiveInterpreter.runsource
+    def runsource(self, source, filename="<input>", symbol="single"):
+        # Redirect stdout to capture print statements
----------------
JDevlieghere wrote:
Nit: missing period. 
https://github.com/llvm/llvm-project/pull/109440
    
    
More information about the lldb-commits
mailing list