- Add upstream change:

* 0001-Lazy-Init-Support-Lazy-Subtypes-amended.patch

OBS-URL: https://build.opensuse.org/package/show/KDE:Qt6/python3-pyside6?expand=0&rev=82
This commit is contained in:
Christophe Marin 2024-10-14 07:39:07 +00:00 committed by Git OBS Bridge
parent 709caa64e7
commit d67efcb8eb
3 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,54 @@
From e67404e0715d9d6a27e52dbd0be9c34643a89a03 Mon Sep 17 00:00:00 2001
From: Christian Tismer <tismer@stackless.com>
Date: Sun, 13 Oct 2024 23:29:47 +0200
Subject: [PATCH] Lazy Init: Support Lazy Subtypes, amended
The addition of nested types made it necessary to filter
subtypes out of resolveLazyClasses because incarnateType
should be called for toplevel types, only.
Task-number: PYSIDE-2404
Change-Id: I4b95c0f65c055376defb6a8e9ea888285c82a8e2
Fixes: PYSIDE-2888
Pick-to: 6.8
---
sources/shiboken6/libshiboken/sbkmodule.cpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sources/shiboken6/libshiboken/sbkmodule.cpp b/sources/shiboken6/libshiboken/sbkmodule.cpp
index acadc60..bca7383 100644
--- a/sources/shiboken6/libshiboken/sbkmodule.cpp
+++ b/sources/shiboken6/libshiboken/sbkmodule.cpp
@@ -93,8 +93,10 @@ static void incarnateHelper(PyObject *module, const std::string_view names,
startPos = dotPos + 1;
dotPos = names.find('.', startPos);
}
- // now we have the type to create.
+ // now we have the type to create. (May be done already)
auto funcIter = nameToFunc.find(std::string(names));
+ if (funcIter == nameToFunc.end())
+ return;
// - call this function that returns a PyTypeObject
auto tcStruct = funcIter->second;
auto initFunc = tcStruct.func;
@@ -174,11 +176,15 @@ void resolveLazyClasses(PyObject *module)
// - see if there are still unloaded elements
auto &nameToFunc = tableIter->second;
- // - incarnate all types.
+ // - incarnate all toplevel types. Subtypes will be handled there.
while (!nameToFunc.empty()) {
auto it = nameToFunc.begin();
auto attrNameStr = it->first;
- incarnateType(module, attrNameStr.c_str(), nameToFunc);
+ if (attrNameStr.find('.') == std::string::npos) {
+ incarnateType(module, attrNameStr.c_str(), nameToFunc);
+ } else {
+ nameToFunc.erase(it);
+ }
}
}
--
2.47.0

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Oct 14 06:45:34 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Add upstream change:
* 0001-Lazy-Init-Support-Lazy-Subtypes-amended.patch
-------------------------------------------------------------------
Thu Oct 10 20:20:00 UTC 2024 - Christophe Marin <christophe@krop.fr>

View File

@ -53,6 +53,8 @@ Source: https://download.qt.io/official_releases/QtForPython/pyside6/PyS
Patch0: 0001-Always-link-to-python-libraries.patch
# PATCH-FIX-UPSTREAM https://codereview.qt-project.org/c/pyside/pyside-setup/+/567559
Patch1: fix-pytest-qt.patch
# PATCH-FIX-UPSTREAM https://bugreports.qt.io/browse/PYSIDE-2888
Patch2: 0001-Lazy-Init-Support-Lazy-Subtypes-amended.patch
# SECTION common_dependencies
BuildRequires: clang-devel
BuildRequires: %{mypython}-Sphinx