aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-11-22 10:07:19 +0100
committerChristian Tismer <tismer@stackless.com>2021-11-22 17:02:36 +0100
commitcff76d051133a5c8ff95f272134f7ee55f57bceb (patch)
treee000741e227130f399e0cab9569c9168dffbf310
parentea3851cdaf7f13f62fe9ae23b96750cd70468294 (diff)
signature: avoid false positives in .pyi import
The standard imports into .pyi files are computed with a regex that scans the source for the usage of such imports. Enhance the regex to avoid false positives. Task-number: PYSIDE-1675 Change-Id: If79c278c3da0b347bb09e9b9d662c9ca56ab5716 Pick-to: 6.2 5.15 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py
index d2a737c91..2ca969ad9 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py
@@ -212,7 +212,7 @@ def filter_from_imports(from_struct, text):
lis = []
nfs.append((mod, lis))
for each in imports:
- if re.search(rf"(\b|@){each}\b", text):
+ if re.search(rf"(\b|@){each}\b([^\s\(:]|\n)", text):
lis.append(each)
if not lis:
nfs.pop()