diff options
| author | Christian Tismer <tismer@stackless.com> | 2021-11-22 10:07:19 +0100 |
|---|---|---|
| committer | Christian Tismer <tismer@stackless.com> | 2021-11-22 17:02:36 +0100 |
| commit | cff76d051133a5c8ff95f272134f7ee55f57bceb (patch) | |
| tree | e000741e227130f399e0cab9569c9168dffbf310 | |
| parent | ea3851cdaf7f13f62fe9ae23b96750cd70468294 (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.py | 2 |
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() |
