Skip to content

Commit

Permalink
Use LoadDLLinExtensionModule instead of LoadDLL in RttiModule/uMain.pas
Browse files Browse the repository at this point in the history
  • Loading branch information
pyscripter committed May 31, 2024
1 parent 4426ae3 commit 38b228f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion Modules/DemoModule/uMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function PyInit_DemoModule: PPyObject;
try
gEngine := TPythonEngine.Create(nil);
gEngine.AutoFinalize := False;
gEngine.UseLastKnownVersion := False;
gEngine.UseLastKnownVersion := True;

gModule := TPythonModule.Create(nil);
Expand Down
7 changes: 2 additions & 5 deletions Modules/RttiModule/uMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ function PyInit_DemoModule: PPyObject;
try
gEngine := TPythonEngine.Create(nil);
gEngine.AutoFinalize := False;
gEngine.UseLastKnownVersion := False;
// Adapt to the desired python version
gEngine.RegVersion := '3.8';
gEngine.DllName := 'python38.dll';
gEngine.UseLastKnownVersion := True;

gModule := TPythonModule.Create(nil);
gModule.Engine := gEngine;
Expand All @@ -47,7 +44,7 @@ function PyInit_DemoModule: PPyObject;
gDelphiWrapper.Engine := gEngine;
gDelphiWrapper.Module := gModule;

gEngine.LoadDll;
gEngine.LoadDllInExtensionModule;
Py := gDelphiWrapper.Wrap(DelphiFunctions, TObjectOwnership.soReference);
gModule.SetVar('delphi_funcs', Py);
gEngine.Py_DecRef(Py);
Expand Down

0 comments on commit 38b228f

Please sign in to comment.