Skip to content

Commit 38b24e2

Browse files
committed
Fix #334
Fix #324
1 parent d88811b commit 38b24e2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Source/PythonEngine.pas

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5185,7 +5185,12 @@ function TPythonEngine.VariantAsPyObject( const V : Variant ) : PPyObject;
51855185
varShortInt,
51865186
varWord,
51875187
varLongWord,
5188-
varInteger: Result := PyLong_FromLong( DeRefV );
5188+
{$IFDEF FPC}
5189+
// See https://github.com/pyscripter/python4delphi/issues/334
5190+
varInteger: Result := PyLong_FromLong(Integer(DeRefV));
5191+
{$ELSE}
5192+
varInteger: Result := PyLong_FromLong(DeRefV);
5193+
{$ENDIF}
51895194
varInt64: Result := PyLong_FromLongLong( DeRefV );
51905195
varSingle,
51915196
varDouble,

0 commit comments

Comments
 (0)