Skip to content

Commit

Permalink
fixed, c++11 compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
davilla authored and Memphiz committed Sep 8, 2015
1 parent 7a85f35 commit 95e6801
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions xbmc/interfaces/python/swig.cpp
Expand Up @@ -196,18 +196,29 @@ namespace PythonBindings
PyObject *tracebackModule = PyImport_ImportModule("traceback");
if (tracebackModule != NULL)
{
PyObject *tbList = PyObject_CallMethod(tracebackModule, "format_exception", "OOO", exc_type, exc_value == NULL ? Py_None : exc_value, exc_traceback == NULL ? Py_None : exc_traceback);
PyObject *emptyString = PyString_FromString("");
PyObject *strRetval = PyObject_CallMethod(emptyString, "join", "O", tbList);

str = PyString_AsString(strRetval);
if (str != NULL)
exceptionTraceback = str;

Py_DECREF(tbList);
Py_DECREF(emptyString);
Py_DECREF(strRetval);
char format_exception[] = "format_exception";
char zeros[] = "000";
PyObject *tbList = PyObject_CallMethod(tracebackModule, format_exception, zeros, exc_type, exc_value == NULL ? Py_None : exc_value, exc_traceback == NULL ? Py_None : exc_traceback);

This comment has been minimized.

Copy link
@LS80

LS80 Sep 23, 2015

Contributor

This is now returning a NULL. The format should be "OOO" not "000".


if (tbList)
{
PyObject *emptyString = PyString_FromString("");
char join[] = "join";
char zero[] = "O";
PyObject *strRetval = PyObject_CallMethod(emptyString, join, zero, tbList);
Py_DECREF(emptyString);

if (strRetval)
{
str = PyString_AsString(strRetval);
if (str != NULL)
exceptionTraceback = str;
Py_DECREF(strRetval);
}
Py_DECREF(tbList);
}
Py_DECREF(tracebackModule);

}
}

Expand Down

4 comments on commit 95e6801

@LS80
Copy link
Contributor

@LS80 LS80 commented on 95e6801 Sep 23, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this commit broke the Python traceback.
More details at http://forum.kodi.tv/showthread.php?tid=239725

@Memphiz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LS80
Copy link
Contributor

@LS80 LS80 commented on 95e6801 Sep 23, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed by #8119.

@MrMC
Copy link

@MrMC MrMC commented on 95e6801 Sep 23, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, can't test under MrMC as python has been ripped out.

Please sign in to comment.