diff options
| author | Ece Cinucen <ece.cinucen@qt.io> | 2025-07-29 17:22:02 +0200 |
|---|---|---|
| committer | Ece Cinucen <ece.cinucen@qt.io> | 2025-07-30 09:23:34 +0200 |
| commit | c22dd4fb11f8279b1946094e057988b7b40ea07c (patch) | |
| tree | 9b5aff2bd60f4b26ab62d6ea3626c1270dcca06e | |
| parent | efd8944b263a099e901ab588bc2d9357554f6ead (diff) | |
type-hints: Temporary fix for typing.Union
Added a workaround to handle where 'typing.Union' is represented as '<class 'typing.Union'>' during signature parsing.
Pick-to: 6.9 6.8
Task-number: PYSIDE-3147
Change-Id: I285e65dbf09a5f15429bcd279d89db173f2dff49
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| -rw-r--r-- | sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py index e1b4b2645..bdfe74eb5 100644 --- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py +++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py @@ -312,6 +312,8 @@ def to_string(thing): elif type(thing) is abc.ABCMeta: # collections.abc.Sequence without argument is very different from typing. return f"{thing.__module__}.{thing.__name__}" + elif str(thing) == "<class 'typing.Union'>": + return "typing.Union" # Note: This captures things from the typing module: return str(thing) |
