Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 38b228f

Browse filesBrowse files
committed
Use LoadDLLinExtensionModule instead of LoadDLL in RttiModule/uMain.pas
1 parent 4426ae3 commit 38b228f
Copy full SHA for 38b228f

File tree

2 files changed

+2
-6
lines changed
Filter options

2 files changed

+2
-6
lines changed

‎Modules/DemoModule/uMain.pas

Copy file name to clipboardExpand all lines: Modules/DemoModule/uMain.pas
-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ function PyInit_DemoModule: PPyObject;
4949
try
5050
gEngine := TPythonEngine.Create(nil);
5151
gEngine.AutoFinalize := False;
52-
gEngine.UseLastKnownVersion := False;
5352
gEngine.UseLastKnownVersion := True;
5453

5554
gModule := TPythonModule.Create(nil);

‎Modules/RttiModule/uMain.pas

Copy file name to clipboardExpand all lines: Modules/RttiModule/uMain.pas
+2-5
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ function PyInit_DemoModule: PPyObject;
3434
try
3535
gEngine := TPythonEngine.Create(nil);
3636
gEngine.AutoFinalize := False;
37-
gEngine.UseLastKnownVersion := False;
38-
// Adapt to the desired python version
39-
gEngine.RegVersion := '3.8';
40-
gEngine.DllName := 'python38.dll';
37+
gEngine.UseLastKnownVersion := True;
4138

4239
gModule := TPythonModule.Create(nil);
4340
gModule.Engine := gEngine;
@@ -47,7 +44,7 @@ function PyInit_DemoModule: PPyObject;
4744
gDelphiWrapper.Engine := gEngine;
4845
gDelphiWrapper.Module := gModule;
4946

50-
gEngine.LoadDll;
47+
gEngine.LoadDllInExtensionModule;
5148
Py := gDelphiWrapper.Wrap(DelphiFunctions, TObjectOwnership.soReference);
5249
gModule.SetVar('delphi_funcs', Py);
5350
gEngine.Py_DecRef(Py);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.