From 57af6dfbd56f4f90950e84a4b4cf8d3caedae95a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 30 Nov 2017 16:10:23 +0100 Subject: libpyside: Fix code forwarding Python exceptions to JS Change-Id: I6dffab506814e1d33812ed23b3e3920882b6c4e6 Reviewed-by: Lars Knoll --- sources/pyside2/libpyside/signalmanager.cpp.in | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/sources/pyside2/libpyside/signalmanager.cpp.in b/sources/pyside2/libpyside/signalmanager.cpp.in index 8ede09610..08c57c218 100644 --- a/sources/pyside2/libpyside/signalmanager.cpp.in +++ b/sources/pyside2/libpyside/signalmanager.cpp.in @@ -471,24 +471,14 @@ int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id, if (data && !data->jsWrapper.isNullOrUndefined()) { QV4::ExecutionEngine *engine = data->jsWrapper.engine(); - -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) - QV4::Heap::ExecutionContext *ctx = engine->current; -#elif QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) - QV4::Heap::ExecutionContext *ctx = engine->currentContext(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) + if (engine->currentStackFrame != nullptr) { +#elif QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) + if (engine->currentContext->d() != engine->rootContext()->d()) { #else QV4::ExecutionContext *ctx = engine->currentContext(); -#endif - -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) if (ctx->type == QV4::Heap::ExecutionContext::Type_CallContext || ctx->type == QV4::Heap::ExecutionContext::Type_SimpleCallContext) { -#elif QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) - if (ctx->d()->type == QV4::ExecutionContext::Type_CallContext || - ctx->d()->type == QV4::ExecutionContext::Type_SimpleCallContext) { -#else - if (ctx->type == QV4::ExecutionContext::Type_CallContext || - ctx->type == QV4::ExecutionContext::Type_SimpleCallContext) { #endif PyObject *errType, *errValue, *errTraceback; PyErr_Fetch(&errType, &errValue, &errTraceback); -- cgit v1.2.3