diff options
author | Christian Tismer <tismer@stackless.com> | 2021-11-22 10:07:19 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-11-22 17:29:15 +0000 |
commit | 2681218966d04485c6c24ea8a90e09750b1e0cec (patch) | |
tree | 91e3d2fb6136f7a93f1be3002991a1adf04029c9 | |
parent | f83bd5cb4c9f2075b9e7a9dcf9046a9c6c489d7a (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
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit cff76d051133a5c8ff95f272134f7ee55f57bceb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 8fd388cd7..36f871520 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 @@ -220,7 +220,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() |