mirror of
https://github.com/cemu-project/idapython.git
synced 2026-01-31 01:15:17 +01:00
- applied patchs for IDA 6.4 SP from Hex-Rays
- fixed idc.CommentEx() - minor mods
This commit is contained in:
10
python.cpp
10
python.cpp
@@ -427,25 +427,25 @@ static int PyRunFile(const char *FileName)
|
||||
}
|
||||
#endif
|
||||
|
||||
PyObject *PyFileObject = PyFile_FromString((char*)FileName, "r");
|
||||
PyObject *file_obj = PyFile_FromString((char*)FileName, "r"); //lint !e1776
|
||||
PyObject *globals = GetMainGlobals();
|
||||
if ( globals == NULL || PyFileObject == NULL )
|
||||
if ( globals == NULL || file_obj == NULL )
|
||||
{
|
||||
Py_XDECREF(PyFileObject);
|
||||
Py_XDECREF(file_obj);
|
||||
return 0;
|
||||
}
|
||||
PyErr_Clear();
|
||||
|
||||
PYW_GIL_ENSURE;
|
||||
PyObject *result = PyRun_File(
|
||||
PyFile_AsFile(PyFileObject),
|
||||
PyFile_AsFile(file_obj),
|
||||
FileName,
|
||||
Py_file_input,
|
||||
globals,
|
||||
globals);
|
||||
PYW_GIL_RELEASE;
|
||||
|
||||
Py_XDECREF(PyFileObject);
|
||||
Py_XDECREF(file_obj);
|
||||
Py_XDECREF(result);
|
||||
|
||||
return result != NULL && !PyErr_Occurred();
|
||||
|
||||
Reference in New Issue
Block a user