File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -77,12 +77,18 @@ function TryLoadVerFromModuleDefs(): boolean;
7777      gEngine.DllPath := LPythonLib;
7878    end ;
7979
80+     var  LPythonSharedLib := String.Empty;
81+     if  LJson.TryGetValue<string>(' python_shared_lib' then  begin 
82+       gEngine.DllName := LPythonSharedLib;
83+     end ;
84+ 
8085    var  LPythonVer: string;
8186    if  LJson.TryGetValue<string>(' python_ver' then  begin 
8287      for  var  I := Low(PYTHON_KNOWN_VERSIONS) to  High(PYTHON_KNOWN_VERSIONS) do  begin 
8388        if  (PYTHON_KNOWN_VERSIONS[I].RegVersion = LPythonVer) then  begin 
8489          gEngine.RegVersion := PYTHON_KNOWN_VERSIONS[I].RegVersion;
85-           gEngine.DllName := PYTHON_KNOWN_VERSIONS[I].DllName;
90+           if  LPythonSharedLib.IsEmpty() then 
91+             gEngine.DllName := PYTHON_KNOWN_VERSIONS[I].DllName;
8692          Dump(Format(' Module has been set to Python %s using the module defs file' 
8793          Exit(true);
8894        end ;
@@ -126,13 +132,14 @@ function PyInit_DelphiFMX: PPyObject;
126132    gDelphiWrapper.Module  := gModule;
127133
128134    gEngine.LoadDll;
135+     Result := gModule.Module ;
129136  except 
130137    on E: Exception do  begin 
131138      WriteLn(' An error occurred: ' 
132139      Dump(E.Message);
140+       Result := gEngine.ReturnNone;
133141    end ;
134142  end ;
135-   Result := gModule.Module ;
136143end ;
137144
138145initialization 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments