Skip to content

Commit 5f9cf2d

Browse files
committed
1 parent e6080ff commit 5f9cf2d

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Source/PythonEngine.pas

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9039,12 +9039,21 @@ procedure PythonVersionFromDLLName(LibName: string; out MajorVersion, MinorVersi
90399039
else //unknown char after major version
90409040
exit;
90419041
end;
9042-
NPos:= Pos('.', LibName); //dot with extension is required
9043-
if NPos=0 then exit;
9044-
Delete(LibName, NPos, MaxInt);
9045-
//support minor versions 0...MaxInt
9042+
//strip file extension and handle 'libpython3.10m.so'
9043+
for NPos:= 1 to Length(LibName) do
9044+
begin
9045+
case LibName[NPos] of
9046+
'.', 'a'..'z':
9047+
begin
9048+
SetLength(LibName, NPos-1);
9049+
Break
9050+
end;
9051+
end;
9052+
end;
9053+
//the rest is minor version number '0'...'999'
90469054
MinorVersion:= StrToIntDef(LibName, 0);
90479055
end;
90489056

9057+
90499058
end.
90509059

0 commit comments

Comments
 (0)