[lldb/ScriptInterpreter] Let the IORedirect factory handle IO being disabled.

Have one factory method that decides how to initialize the
ScriptInterpreterIORedirect object based on whether IO is enabled or
disabled.
This commit is contained in:
Jonas Devlieghere committed 2020-06-25 09:55:46 -07:00
1 parent 79d7e9c7d0
commit 842283652e
3 files changed
+12 -18

No files matched your search

@@ -912,10 +912,8 @@ bool ScriptInterpreterPythonImpl::ExecuteOneLine(
// we use the following more complicated method to pass the command string
// directly down to Python.
llvm::Expected<std::unique_ptr<ScriptInterpreterIORedirect>>
io_redirect_or_error =
options.GetEnableIO()
? ScriptInterpreterIORedirect::Create(m_debugger, result)
: ScriptInterpreterIORedirect::Create();
io_redirect_or_error = ScriptInterpreterIORedirect::Create(
options.GetEnableIO(), m_debugger, result);
if (!io_redirect_or_error) {
if (result)
result->AppendErrorWithFormatv(