[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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user