Fixed an issue where LLDB was complaining about the lack of 'update' in a synthetic provider, despite it being optional

llvm-svn: 137330
This commit is contained in:
Enrico Granata
2011-08-11 19:20:44 +00:00
parent 0a76c28a87
commit a365f296e6
2 changed files with 17 additions and 0 deletions

View File

@@ -523,6 +523,11 @@ LLDBSwigPython_UpdateSynthProviderInstance
// other synth provider calls are mandatory, so we want to fail in a very obvious way if they are missing!
PyObject* pmeth = PyObject_GetAttrString(implementor, callee_name);
if (PyErr_Occurred())
{
PyErr_Clear();
}
if (pmeth == NULL || pmeth == Py_None)
{
Py_XDECREF(pmeth);
@@ -531,10 +536,20 @@ LLDBSwigPython_UpdateSynthProviderInstance
if (PyCallable_Check(pmeth) == 0)
{
if (PyErr_Occurred())
{
PyErr_Clear();
}
Py_XDECREF(pmeth);
return;
}
if (PyErr_Occurred())
{
PyErr_Clear();
}
Py_XDECREF(pmeth);
// right now we know this function exists and is callable..