Skip to content

Commit 7b174c7

Browse files
committed
Preparing for Python 3.8. Will not work until https://bugs.python.org/issue37189 is fixed in beta 2.
1 parent c9a6dda commit 7b174c7

File tree

2 files changed

+43
-21
lines changed

2 files changed

+43
-21
lines changed

PythonForDelphi/Components/Sources/Core/Definition.Inc

+34-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(**************************************************************************)
1+
(**************************************************************************)
22
(* *)
33
(* Module: 'Definition.Inc' Copyright (c) 1998 *)
44
(* *)
@@ -38,6 +38,7 @@
3838
//{$DEFINE PYTHON35}
3939
//{$DEFINE PYTHON36}
4040
//{$DEFINE PYTHON37}
41+
//{$DEFINE PYTHON38}
4142

4243
/////////////////////////////////////////////////////////////////////////////
4344
// Python for Delphi settings. Comment out the setting you want to enable.
@@ -418,21 +419,23 @@
418419
// Note that the installer will let the user specify its default Python version, and
419420
// thus will edit this file.
420421

421-
{$IFNDEF PYTHON37}
422-
{$IFNDEF PYTHON36}
423-
{$IFNDEF PYTHON35}
424-
{$IFNDEF PYTHON34}
425-
{$IFNDEF PYTHON33}
426-
{$IFNDEF PYTHON32}
427-
{$IFNDEF PYTHON31}
428-
{$IFNDEF PYTHON30}
429-
{$IFNDEF PYTHON27}
430-
{$IFNDEF PYTHON26}
431-
{$IFNDEF PYTHON25}
432-
{$IFNDEF PYTHON24}
433-
{---<START OF DEFAULT PYTHON VERSION>---}
434-
{$DEFINE PYTHON27}
435-
{---<END OF DEFAULT PYTHON VERSION>---}
422+
{$IFNDEF PYTHON38}
423+
{$IFNDEF PYTHON37}
424+
{$IFNDEF PYTHON36}
425+
{$IFNDEF PYTHON35}
426+
{$IFNDEF PYTHON34}
427+
{$IFNDEF PYTHON33}
428+
{$IFNDEF PYTHON32}
429+
{$IFNDEF PYTHON31}
430+
{$IFNDEF PYTHON30}
431+
{$IFNDEF PYTHON27}
432+
{$IFNDEF PYTHON26}
433+
{$IFNDEF PYTHON25}
434+
{$IFNDEF PYTHON24}
435+
{---<START OF DEFAULT PYTHON VERSION>---}
436+
{$DEFINE PYTHON27}
437+
{---<END OF DEFAULT PYTHON VERSION>---}
438+
{$ENDIF}
436439
{$ENDIF}
437440
{$ENDIF}
438441
{$ENDIF}
@@ -446,7 +449,6 @@
446449
{$ENDIF}
447450
{$ENDIF}
448451

449-
450452
{$IFDEF PYTHON24}
451453
{$DEFINE PYTHON24_OR_HIGHER}
452454
{$ENDIF}
@@ -549,6 +551,21 @@
549551
{$DEFINE PYTHON36_OR_HIGHER}
550552
{$DEFINE PYTHON37_OR_HIGHER}
551553
{$ENDIF}
554+
{$IFDEF PYTHON38}
555+
{$DEFINE PYTHON24_OR_HIGHER}
556+
{$DEFINE PYTHON25_OR_HIGHER}
557+
{$DEFINE PYTHON26_OR_HIGHER}
558+
{$DEFINE PYTHON27_OR_HIGHER}
559+
{$DEFINE PYTHON30_OR_HIGHER}
560+
{$DEFINE PYTHON31_OR_HIGHER}
561+
{$DEFINE PYTHON32_OR_HIGHER}
562+
{$DEFINE PYTHON33_OR_HIGHER}
563+
{$DEFINE PYTHON34_OR_HIGHER}
564+
{$DEFINE PYTHON35_OR_HIGHER}
565+
{$DEFINE PYTHON36_OR_HIGHER}
566+
{$DEFINE PYTHON37_OR_HIGHER}
567+
{$DEFINE PYTHON38_OR_HIGHER}
568+
{$ENDIF}
552569

553570
/////////////////////////////////////////////////////////////////////////////
554571
// Misc

PythonForDelphi/Components/Sources/Core/PythonEngine.pas

+9-4
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ interface
129129
end;
130130
const
131131
{$IFDEF MSWINDOWS}
132-
PYTHON_KNOWN_VERSIONS: array[1..12] of TPythonVersionProp =
132+
PYTHON_KNOWN_VERSIONS: array[1..13] of TPythonVersionProp =
133133
( (DllName: 'python24.dll'; RegVersion: '2.4'; APIVersion: 1012; CanUseLatest: True),
134134
(DllName: 'python25.dll'; RegVersion: '2.5'; APIVersion: 1013; CanUseLatest: True),
135135
(DllName: 'python26.dll'; RegVersion: '2.6'; APIVersion: 1013; CanUseLatest: True),
@@ -141,10 +141,11 @@ interface
141141
(DllName: 'python34.dll'; RegVersion: '3.4'; APIVersion: 1013; CanUseLatest: True),
142142
(DllName: 'python35.dll'; RegVersion: '3.5'; APIVersion: 1013; CanUseLatest: True),
143143
(DllName: 'python36.dll'; RegVersion: '3.6'; APIVersion: 1013; CanUseLatest: True),
144-
(DllName: 'python37.dll'; RegVersion: '3.7'; APIVersion: 1013; CanUseLatest: True) );
144+
(DllName: 'python37.dll'; RegVersion: '3.7'; APIVersion: 1013; CanUseLatest: True),
145+
(DllName: 'python38.dll'; RegVersion: '3.8'; APIVersion: 1013; CanUseLatest: True) );
145146
{$ENDIF}
146147
{$IFDEF LINUX}
147-
PYTHON_KNOWN_VERSIONS: array[1..12] of TPythonVersionProp =
148+
PYTHON_KNOWN_VERSIONS: array[1..13] of TPythonVersionProp =
148149
( (DllName: 'libpython2.4.so'; RegVersion: '2.4'; APIVersion: 1012; CanUseLatest: True),
149150
(DllName: 'libpython2.5.so'; RegVersion: '2.5'; APIVersion: 1013; CanUseLatest: True),
150151
(DllName: 'libpython2.6.so'; RegVersion: '2.6'; APIVersion: 1013; CanUseLatest: True),
@@ -156,7 +157,8 @@ interface
156157
(DllName: 'libpython3.4.so'; RegVersion: '3.4'; APIVersion: 1013; CanUseLatest: True),
157158
(DllName: 'libpython3.5.so'; RegVersion: '3.5'; APIVersion: 1013; CanUseLatest: True),
158159
(DllName: 'libpython3.6.so'; RegVersion: '3.6'; APIVersion: 1013; CanUseLatest: True)
159-
(DllName: 'libpython3.7.so'; RegVersion: '3.7'; APIVersion: 1013; CanUseLatest: True) );
160+
(DllName: 'libpython3.7.so'; RegVersion: '3.7'; APIVersion: 1013; CanUseLatest: True)
161+
(DllName: 'libpython3.8.so'; RegVersion: '3.8'; APIVersion: 1013; CanUseLatest: True) );
160162
{$ENDIF}
161163
{$IFDEF PYTHON24}
162164
COMPILED_FOR_PYTHON_VERSION_INDEX = 1;
@@ -193,6 +195,9 @@ interface
193195
{$ENDIF}
194196
{$IFDEF PYTHON37}
195197
COMPILED_FOR_PYTHON_VERSION_INDEX = 12;
198+
{$ENDIF}
199+
{$IFDEF PYTHON38}
200+
COMPILED_FOR_PYTHON_VERSION_INDEX = 13;
196201
{$ENDIF}
197202
PYT_METHOD_BUFFER_INCREASE = 10;
198203
PYT_MEMBER_BUFFER_INCREASE = 10;

0 commit comments

Comments
 (0)