Python3 - Fix some issues related to PythonFile class.
Python 3 has lots of new debug asserts, and some of these were firing on PythonFile. Specifically related to handling of invalid files. llvm-svn: 253261
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user