mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
xbmc: update patch to fix python callback error handling
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
4a5a34f705
commit
f47d42e705
@ -1,39 +1,34 @@
|
|||||||
From 4bcbf6a4a0fde61c18d8de66a8d05aa441ab6fc9 Mon Sep 17 00:00:00 2001
|
diff -Naur xbmc-10.1-Dharma/xbmc/lib/libPython/xbmcmodule/pyutil.cpp xbmc-10.1-Dharma.patch/xbmc/lib/libPython/xbmcmodule/pyutil.cpp
|
||||||
From: Jim Carroll <thecarrolls@jiminger.com>
|
--- xbmc-10.1-Dharma/xbmc/lib/libPython/xbmcmodule/pyutil.cpp 2011-03-08 02:49:14.000000000 +0100
|
||||||
Date: Thu, 9 Jun 2011 14:34:24 -0400
|
+++ xbmc-10.1-Dharma.patch/xbmc/lib/libPython/xbmcmodule/pyutil.cpp 2011-06-10 21:14:07.881047162 +0200
|
||||||
Subject: [PATCH] Allow python error information from callbacks to make it to
|
@@ -23,6 +23,7 @@
|
||||||
the log.
|
#include <wchar.h>
|
||||||
|
#include <vector>
|
||||||
---
|
#include "addons/Skin.h"
|
||||||
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"
|
|
||||||
+#include "utils/log.h"
|
+#include "utils/log.h"
|
||||||
|
#include "tinyXML/tinyxml.h"
|
||||||
using namespace std;
|
#include "utils/CharsetConverter.h"
|
||||||
|
#include "CriticalSection.h"
|
||||||
@@ -203,6 +204,13 @@ void _PyXBMC_MakePendingCalls()
|
@@ -202,7 +203,22 @@
|
||||||
|
g_callQueue.erase(iter);
|
||||||
lock.Leave();
|
lock.Leave();
|
||||||
if (p.func)
|
if (p.func)
|
||||||
|
+ {
|
||||||
p.func(p.args);
|
p.func(p.args);
|
||||||
+
|
+
|
||||||
+ if (PyErr_Occurred())
|
+ // Since the callback is likely to make it into python, and since
|
||||||
+ {
|
+ // not all of the callback functions handle errors, the error state
|
||||||
+ CLog::Log(LOGERROR,"Exception in python callback");
|
+ // may remain set from the previous call. As a result subsequent calls
|
||||||
+ PyErr_Print();
|
+ // 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);
|
//(*((*iter).first))((*iter).second);
|
||||||
lock.Enter();
|
lock.Enter();
|
||||||
iter = g_callQueue.begin();
|
iter = g_callQueue.begin();
|
||||||
--
|
|
||||||
1.7.5.4
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user