Skip to content

Commit 331c1d7

Browse files
committed
2 parents c4cb2a9 + b91a188 commit 331c1d7

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

PythonForDelphi/Components/Sources/Core/Definition.Inc

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
//{$DEFINE PYTHON32}
3737
//{$DEFINE PYTHON33}
3838
//{$DEFINE PYTHON34}
39+
//{$DEFINE PYTHON35}
3940

4041
/////////////////////////////////////////////////////////////////////////////
4142
// Python for Delphi settings. Comment out the setting you want to enable.
@@ -322,19 +323,21 @@
322323
// Note that the installer will let the user specify its default Python version, and
323324
// thus will edit this file.
324325

325-
{$IFNDEF PYTHON34}
326-
{$IFNDEF PYTHON33}
327-
{$IFNDEF PYTHON32}
328-
{$IFNDEF PYTHON31}
329-
{$IFNDEF PYTHON30}
330-
{$IFNDEF PYTHON27}
331-
{$IFNDEF PYTHON26}
332-
{$IFNDEF PYTHON25}
333-
{$IFNDEF PYTHON24}
334-
{$IFNDEF PYTHON23}
335-
{---<START OF DEFAULT PYTHON VERSION>---}
336-
{$DEFINE PYTHON27}
337-
{---<END OF DEFAULT PYTHON VERSION>---}
326+
{$IFNDEF PYTHON35}
327+
{$IFNDEF PYTHON34}
328+
{$IFNDEF PYTHON33}
329+
{$IFNDEF PYTHON32}
330+
{$IFNDEF PYTHON31}
331+
{$IFNDEF PYTHON30}
332+
{$IFNDEF PYTHON27}
333+
{$IFNDEF PYTHON26}
334+
{$IFNDEF PYTHON25}
335+
{$IFNDEF PYTHON24}
336+
{$IFNDEF PYTHON23}
337+
{---<START OF DEFAULT PYTHON VERSION>---}
338+
{$DEFINE PYTHON27}
339+
{---<END OF DEFAULT PYTHON VERSION>---}
340+
{$ENDIF}
338341
{$ENDIF}
339342
{$ENDIF}
340343
{$ENDIF}

PythonForDelphi/Components/Sources/Core/PythonEngine.pas

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ interface
126126
end;
127127
const
128128
{$IFDEF MSWINDOWS}
129-
PYTHON_KNOWN_VERSIONS: array[1..10] of TPythonVersionProp =
129+
PYTHON_KNOWN_VERSIONS: array[1..12] of TPythonVersionProp =
130130
( (DllName: 'python23.dll'; RegVersion: '2.3'; APIVersion: 1012; CanUseLatest: True),
131131
(DllName: 'python24.dll'; RegVersion: '2.4'; APIVersion: 1012; CanUseLatest: True),
132132
(DllName: 'python25.dll'; RegVersion: '2.5'; APIVersion: 1013; CanUseLatest: True),
@@ -136,10 +136,12 @@ interface
136136
(DllName: 'python31.dll'; RegVersion: '3.1'; APIVersion: 1013; CanUseLatest: True),
137137
(DllName: 'python32.dll'; RegVersion: '3.2'; APIVersion: 1013; CanUseLatest: True),
138138
(DllName: 'python33.dll'; RegVersion: '3.3'; APIVersion: 1013; CanUseLatest: True),
139-
(DllName: 'python34.dll'; RegVersion: '3.4'; APIVersion: 1013; CanUseLatest: True) );
139+
(DllName: 'python34.dll'; RegVersion: '3.4'; APIVersion: 1013; CanUseLatest: True),
140+
(DllName: 'python35.dll'; RegVersion: '3.5-32'; APIVersion: 1013; CanUseLatest: True),
141+
(DllName: 'python35.dll'; RegVersion: '3.5-64'; APIVersion: 1013; CanUseLatest: True) );
140142
{$ENDIF}
141143
{$IFDEF LINUX}
142-
PYTHON_KNOWN_VERSIONS: array[1..10] of TPythonVersionProp =
144+
PYTHON_KNOWN_VERSIONS: array[1..11] of TPythonVersionProp =
143145
( (DllName: 'libpython2.3.so'; RegVersion: '2.3'; APIVersion: 1012; CanUseLatest: True),
144146
(DllName: 'libpython2.4.so'; RegVersion: '2.4'; APIVersion: 1012; CanUseLatest: True),
145147
(DllName: 'libpython2.5.so'; RegVersion: '2.5'; APIVersion: 1013; CanUseLatest: True),
@@ -149,7 +151,8 @@ interface
149151
(DllName: 'libpython3.1.so'; RegVersion: '3.1'; APIVersion: 1013; CanUseLatest: True),
150152
(DllName: 'libpython3.2.so'; RegVersion: '3.2'; APIVersion: 1013; CanUseLatest: True),
151153
(DllName: 'libpython3.3.so'; RegVersion: '3.3'; APIVersion: 1013; CanUseLatest: True),
152-
(DllName: 'libpython3.4.so'; RegVersion: '3.4'; APIVersion: 1013; CanUseLatest: True) );
154+
(DllName: 'libpython3.4.so'; RegVersion: '3.4'; APIVersion: 1013; CanUseLatest: True),
155+
(DllName: 'libpython3.5.so'; RegVersion: '3.5'; APIVersion: 1013; CanUseLatest: True) );
153156
{$ENDIF}
154157
{$IFDEF PYTHON23}
155158
COMPILED_FOR_PYTHON_VERSION_INDEX = 1;
@@ -180,6 +183,9 @@ interface
180183
{$ENDIF}
181184
{$IFDEF PYTHON34}
182185
COMPILED_FOR_PYTHON_VERSION_INDEX = 10;
186+
{$ENDIF}
187+
{$IFDEF PYTHON35}
188+
COMPILED_FOR_PYTHON_VERSION_INDEX = 11;
183189
{$ENDIF}
184190
PYT_METHOD_BUFFER_INCREASE = 10;
185191
PYT_MEMBER_BUFFER_INCREASE = 10;
@@ -4693,7 +4699,11 @@ procedure TPythonEngine.DoOpenDll(const aDllName : String);
46934699
for i:= Integer(COMPILED_FOR_PYTHON_VERSION_INDEX) to High(PYTHON_KNOWN_VERSIONS) do
46944700
begin
46954701
RegVersion := PYTHON_KNOWN_VERSIONS[i].RegVersion;
4696-
FDLLHandle := SafeLoadLibrary(GetDllPath+PYTHON_KNOWN_VERSIONS[i].DllName);
4702+
try
4703+
FDLLHandle := SafeLoadLibrary(GetDllPath+PYTHON_KNOWN_VERSIONS[i].DllName);
4704+
except
4705+
FDLLHandle:=0;
4706+
end;
46974707
if IsHandleValid then
46984708
begin
46994709
DllName := PYTHON_KNOWN_VERSIONS[i].DllName;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy