diff options
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index e3f84f53df0..3107677ee94 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -1035,6 +1035,12 @@ PythonFile::Reset(PyRefType type, PyObject *py_obj) void PythonFile::Reset(File &file, const char *mode) { + if (!file.IsValid()) + { + Reset(); + return; + } + char *cmode = const_cast<char *>(mode); #if PY_MAJOR_VERSION >= 3 Reset(PyRefType::Owned, |