Skip to content

Commit d865565

Browse files
committed
Fix GetHelpFile and take account of the fact that python 11 includes html documentation.
1 parent e77cf44 commit d865565

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Source/PythonVersions.pas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ function TPythonVersion.GetHelpFile: string;
170170
SR: TSearchRec;
171171
begin
172172
Result := FHelpFile;
173-
// for unregistered Python
174-
if (Result = '') and (InstallPath <> '') then
173+
// for unregistered Python or python 11
174+
if ((Result = '') or (ExtractFileExt(Result) = '.html')) and (InstallPath <> '') then
175175
begin
176-
PythonHelpFilePath := InstallPath + '\Doc\python*.chm';
176+
PythonHelpFilePath := IncludeTrailingPathDelimiter(InstallPath) + 'Doc\python*.chm';
177177
Res := FindFirst(PythonHelpFilePath, faAnyFile, SR);
178178
if Res = 0 then
179-
Result := InstallPath + '\Doc\' + SR.Name;
179+
Result := IncludeTrailingPathDelimiter(InstallPath) + 'Doc\' + SR.Name;
180180
FindClose(SR);
181181
end;
182182
end;

0 commit comments

Comments
 (0)