aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2025-04-16 13:09:38 +0200
committerFriedemann Kleint <[email protected]>2025-04-17 11:34:05 +0200
commit30be4cdd1d0fe0f83090f4d695aa3379af821828 (patch)
tree8fe5fbb07026fc90078968982c40254dce5502ce
parenta4790d33c4251b7f628ec7478767582f0b06a8c5 (diff)
Fix building of .pyi files for Windows debug
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 Pick-to: 6.9 6.8 Change-Id: I2989ec411ae73790515ac282a2c3eccc7d222c97 Reviewed-by: Cristian Maureira-Fredes <[email protected]>
-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: