aboutsummaryrefslogtreecommitdiffstats
diff options
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2025-04-16 13:09:38 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2025-04-17 13:08:13 +0000
commit254e47a4862b1bdb7557490877febcc9e8614e9c (patch)
treeca6ded8406851271e65f6e19f3266e67d1260dc2
parenta82542517b43cb89eae2efd5aef06d27bdbcbde8 (diff)
Fix building of .pyi files for Windows debug6.8
Port an incomprehensible list comprehension to pathlib and strip the "_d" debug prefix from the file name. Amends 3d9e42f33fad5b2eeee62d3eced1c69aa7f35fff. Fixes: PYSIDE-3061 Task-number: PYSIDE-1890 Task-number: PYSIDE-2895 Change-Id: I2989ec411ae73790515ac282a2c3eccc7d222c97 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 30be4cdd1d0fe0f83090f4d695aa3379af821828) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 16e1b265d0d30963980deea7e033f46aa6ca8c0f)
-rw-r--r--sources/pyside6/PySide6/__init__.py.in11
1 files changed, 7 insertions, 4 deletions
diff --git a/sources/pyside6/PySide6/__init__.py.in b/sources/pyside6/PySide6/__init__.py.in
index 45c19f2e9..197eba963 100644
--- a/sources/pyside6/PySide6/__init__.py.in
+++ b/sources/pyside6/PySide6/__init__.py.in
@@ -101,10 +101,13 @@ def _find_all_qt_modules():
# Instead, we use __getattr__ which is supported since Python 3.7
# and create the __all__ list on demand when needed.
- location = Path(__file__).resolve().parent
- files = os.listdir(location)
- unordered = set(name[: name.find(".")] for name in files if name.startswith("Qt") and (
- name.endswith((".pyd", ".so"))))
+ unordered = set()
+ pattern = "Qt*.pyd" if sys.platform == "win32" else "Qt*.so"
+ for module in Path(__file__).resolve().parent.glob(pattern):
+ name = module.name[:module.name.find(".")]
+ if name.endswith("_d"): # Windows debug suffix?
+ name = name[:-2]
+ unordered.add(name)
ordered_part = __pre_all__
result = []
for name in ordered_part: