Changeset View
Changeset View
Standalone View
Standalone View
source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
Context not available. | |||||
Reset(file, mode); | Reset(file, mode); | ||||
} | } | ||||
PythonFile::PythonFile(const char *path, const char *mode) | |||||
{ | |||||
FILE *fp = nullptr; | |||||
fp = fopen(path, mode); | |||||
lldb_private::File file(fp, true); | |||||
Reset(file, mode); | |||||
} | |||||
PythonFile::PythonFile(PyRefType type, PyObject *o) | PythonFile::PythonFile(PyRefType type, PyObject *o) | ||||
{ | { | ||||
Reset(type, o); | Reset(type, o); | ||||
Context not available. | |||||
#endif | #endif | ||||
} | } | ||||
bool | |||||
PythonFile::GetUnderlyingFile(File &file) const | |||||
{ | |||||
if (!IsValid()) | |||||
return false; | |||||
file.Close(); | |||||
// We don't own the file descriptor returned by this function, make sure the | |||||
// File object knows about that. | |||||
file.SetDescriptor(PyObject_AsFileDescriptor(m_py_obj), false); | |||||
return file.IsValid(); | |||||
} | |||||
#endif | #endif | ||||
Context not available. |