Skip to content

Commit d6a72ea

Browse files
committed
add support for Python 3.12
1 parent 707ce47 commit d6a72ea

6 files changed

Lines changed: 16 additions & 20 deletions

File tree

src/common/cefpython_public_api.h

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,16 @@
3434
#define DL_EXPORT(RTYPE) RTYPE
3535
#endif
3636

37-
#if PY_MAJOR_VERSION == 2
38-
#if PY_MINOR_VERSION == 7
39-
#include "../../build/build_cefpython/cefpython_py27_fixed.h"
40-
#endif // PY_MINOR_VERSION
41-
#elif PY_MAJOR_VERSION == 3
42-
#if PY_MINOR_VERSION == 4
43-
#include "../../build/build_cefpython/cefpython_py34_fixed.h"
44-
#elif PY_MINOR_VERSION == 5
45-
#include "../../build/build_cefpython/cefpython_py35_fixed.h"
46-
#elif PY_MINOR_VERSION == 6
47-
#include "../../build/build_cefpython/cefpython_py36_fixed.h"
48-
#elif PY_MINOR_VERSION == 7
49-
#include "../../build/build_cefpython/cefpython_py37_fixed.h"
50-
#elif PY_MINOR_VERSION == 8
51-
#include "../../build/build_cefpython/cefpython_py38_fixed.h"
52-
#elif PY_MINOR_VERSION == 9
37+
38+
#if PY_MAJOR_VERSION == 3
39+
#if PY_MINOR_VERSION == 9
5340
#include "../../build/build_cefpython/cefpython_py39_fixed.h"
5441
#elif PY_MINOR_VERSION == 10
5542
#include "../../build/build_cefpython/cefpython_py310_fixed.h"
5643
#elif PY_MINOR_VERSION == 11
5744
#include "../../build/build_cefpython/cefpython_py311_fixed.h"
45+
#elif PY_MINOR_VERSION == 12
46+
#include "../../build/build_cefpython/cefpython_py312_fixed.h"
5847
#endif // PY_MINOR_VERSION
5948
#endif // PY_MAJOR_VERSION
6049

tools/build_distrib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
ALLOW_PARTIAL = False
8181

8282
# Python versions
83-
SUPPORTED_PYTHON_VERSIONS = [(3, 9), (3.10), (3.11)]
83+
SUPPORTED_PYTHON_VERSIONS = [(3, 9), (3.10), (3.11), (3.12)]
8484

8585
# Python search paths. It will use first Python found for specific version.
8686
# Supports replacement of one environment variable in path eg.: %ENV_KEY%.
@@ -570,7 +570,7 @@ def check_cpp_extension_dependencies_issue359(setup_dir, all_pythons):
570570
return
571571
checked_any = False
572572
for python in all_pythons:
573-
if python["version2"] in ((3, 9), (3, 10), (3, 11)):
573+
if python["version2"] in ((3, 9), (3, 10), (3, 11), (3.12)):
574574
checked_any = True
575575
if not os.path.exists(os.path.join(setup_dir, "cefpython3",
576576
"msvcp140.dll")):

tools/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ def get_msvs_for_python(vs_prefix=False):
470470
return "VS2022" if vs_prefix else "2022"
471471
elif sys.version_info[:2] == (3, 11):
472472
return "VS2022" if vs_prefix else "2022"
473+
elif sys.version_info[:2] == (3, 12):
474+
return "VS2022" if vs_prefix else "2022"
473475
else:
474476
print("ERROR: This version of Python is not supported")
475477
sys.exit(1)

tools/installer/cefpython3.__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,8 @@
5252
from . import cefpython_py310 as cefpython
5353
elif sys.version_info[:2] == (3, 11):
5454
from . import cefpython_py311 as cefpython
55+
elif sys.version_info[:2] == (3, 12):
56+
from . import cefpython_py312 as cefpython
5557
else:
5658
raise Exception("Python version not supported: " + sys.version)
59+

tools/installer/cefpython3.setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def main():
144144
"Programming Language :: Python :: 3.9",
145145
"Programming Language :: Python :: 3.10",
146146
"Programming Language :: Python :: 3.11",
147+
"Programming Language :: Python :: 3.12",
147148
"Topic :: Desktop Environment",
148149
"Topic :: Internet",
149150
"Topic :: Internet :: WWW/HTTP",

tools/make_installer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,11 @@ def copy_cpp_extension_dependencies_issue359(pkg_dir):
364364
# required as well.
365365

366366

367-
# Python 3.9 / 3.10 / 3.11
367+
# Python 3.9 / 3.10 / 3.11 / 3.12
368368
if os.path.exists(os.path.join(pkg_dir, "cefpython_py39.pyd")) \
369369
or os.path.exists(os.path.join(pkg_dir, "cefpython_py310.pyd")) \
370-
or os.path.exists(os.path.join(pkg_dir, "cefpython_py311.pyd")):
370+
or os.path.exists(os.path.join(pkg_dir, "cefpython_py311.pyd")) \
371+
or os.path.exists(os.path.join(pkg_dir, "cefpython_py312.pyd")):
371372
search_paths = [
372373
# This is where Microsoft Visual C++ 2015 Update 3 installs
373374
# (14.00.24212).

0 commit comments

Comments
 (0)