diff --git a/packages/mediacenter/xbmc/patches/xbmc-10.1-Dharma-407-python_callback_error_handling_fix-0.1.patch b/packages/mediacenter/xbmc/patches/xbmc-10.1-Dharma-407-python_callback_error_handling_fix-0.1.patch index 3ed7413e44..d2c8afac28 100644 --- a/packages/mediacenter/xbmc/patches/xbmc-10.1-Dharma-407-python_callback_error_handling_fix-0.1.patch +++ b/packages/mediacenter/xbmc/patches/xbmc-10.1-Dharma-407-python_callback_error_handling_fix-0.1.patch @@ -1,39 +1,34 @@ -From 4bcbf6a4a0fde61c18d8de66a8d05aa441ab6fc9 Mon Sep 17 00:00:00 2001 -From: Jim Carroll -Date: Thu, 9 Jun 2011 14:34:24 -0400 -Subject: [PATCH] Allow python error information from callbacks to make it to - the log. - ---- - xbmc/lib/libPython/xbmcmodule/pyutil.cpp | 8 ++++++++ - 1 files changed, 8 insertions(+), 0 deletions(-) - -diff --git a/xbmc/lib/libPython/xbmcmodule/pyutil.cpp b/xbmc/lib/libPython/xbmcmodule/pyutil.cpp -index 9a98cdf..041f332 100644 ---- a/xbmc/lib/libPython/xbmcmodule/pyutil.cpp -+++ b/xbmc/lib/libPython/xbmcmodule/pyutil.cpp -@@ -28,6 +28,7 @@ - #include "CriticalSection.h" - #include "SingleLock.h" - #include "Application.h" +diff -Naur xbmc-10.1-Dharma/xbmc/lib/libPython/xbmcmodule/pyutil.cpp xbmc-10.1-Dharma.patch/xbmc/lib/libPython/xbmcmodule/pyutil.cpp +--- xbmc-10.1-Dharma/xbmc/lib/libPython/xbmcmodule/pyutil.cpp 2011-03-08 02:49:14.000000000 +0100 ++++ xbmc-10.1-Dharma.patch/xbmc/lib/libPython/xbmcmodule/pyutil.cpp 2011-06-10 21:14:07.881047162 +0200 +@@ -23,6 +23,7 @@ + #include + #include + #include "addons/Skin.h" +#include "utils/log.h" - - using namespace std; - -@@ -203,6 +204,13 @@ void _PyXBMC_MakePendingCalls() + #include "tinyXML/tinyxml.h" + #include "utils/CharsetConverter.h" + #include "CriticalSection.h" +@@ -202,7 +203,22 @@ + g_callQueue.erase(iter); lock.Leave(); if (p.func) ++ { p.func(p.args); + -+ if (PyErr_Occurred()) -+ { -+ CLog::Log(LOGERROR,"Exception in python callback"); -+ PyErr_Print(); -+ } ++ // Since the callback is likely to make it into python, and since ++ // not all of the callback functions handle errors, the error state ++ // may remain set from the previous call. As a result subsequent calls ++ // to callback functions exhibit odd behavior difficult to debug. ++ if (PyErr_Occurred()) ++ { ++ CLog::Log(LOGERROR,"Exception in python script callback execution"); + ++ // This clears the python error state and prints it to the log ++ PyErr_Print(); ++ } ++ ++ } //(*((*iter).first))((*iter).second); lock.Enter(); iter = g_callQueue.begin(); --- -1.7.5.4 -