Skip to content

Commit 0b12557

Browse files
committed
rtti invoke - variant parameter with array inside, final form
1 parent ae50a7e commit 0b12557

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Source/WrapDelphi.pas

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,15 +1040,13 @@ function SimplePythonToValue(PyValue: PPyObject; TypeInfo: PTypeInfo;
10401040
Value := V.Cast(TypeInfo);
10411041
Result := True;
10421042
end;
1043-
tkInteger, tkFloat, tkInt64:
1043+
tkInteger, tkFloat, tkInt64, tkVariant:
10441044
begin
1045-
V := TValue.FromVariant(GetPythonEngine.PyObjectAsVariant(PyValue));
1046-
Value := V.Cast(TypeInfo);
1047-
Result := True;
1048-
end;
1049-
tkVariant:
1050-
begin
1051-
Value := TValue.From<Variant>(GetPythonEngine.PyObjectAsVariant(PyValue));
1045+
V := TValue.From<Variant>(GetPythonEngine.PyObjectAsVariant(PyValue));
1046+
if TypeInfo^.Kind = tkVariant then
1047+
Value := V
1048+
else
1049+
Value := V.Cast(TypeInfo);
10521050
Result := True;
10531051
end;
10541052
tkEnumeration:

0 commit comments

Comments
 (0)