fix(scripts): Union syntax compatible with Python 3.8 (#8641)

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
This commit is contained in:
terry.rong
2025-07-31 01:12:19 +08:00
committed by GitHub
parent b11ac069f4
commit 580b1e733e
+1 -1
View File
@@ -19,7 +19,7 @@ class Value(gdb.Value):
return Value(super().__getattribute__(key))
return Value(super().__getitem__(key))
def cast(self, type_name: str | gdb.Type, ptr: bool = False) -> Optional['Value']:
def cast(self, type_name: Union[str, gdb.Type], ptr: bool = False) -> Optional['Value']:
try:
gdb_type = gdb.lookup_type(type_name) if isinstance(type_name, str) else type_name
if ptr: