Skip to content

Commit 9765c4d

Browse files
committed
windows: pass Python XY version string into function
This needs to be paramaterized so we can support Python 3.8.
1 parent 6b6ae37 commit 9765c4d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

cpython-windows/build.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,7 @@ def build_openssl(perl_path: pathlib.Path, arch: str, profile: str):
11901190
def collect_python_build_artifacts(
11911191
pcbuild_path: pathlib.Path,
11921192
out_dir: pathlib.Path,
1193+
python_majmin: str,
11931194
arch: str,
11941195
config: str,
11951196
static: bool,
@@ -1200,7 +1201,9 @@ def collect_python_build_artifacts(
12001201
the files.
12011202
"""
12021203
outputs_path = pcbuild_path / arch
1203-
intermediates_path = pcbuild_path / "obj" / ("37%s_%s" % (arch, config))
1204+
intermediates_path = (
1205+
pcbuild_path / "obj" / ("%s%s_%s" % (python_majmin, arch, config))
1206+
)
12041207

12051208
if not outputs_path.exists():
12061209
log("%s does not exist" % outputs_path)
@@ -1331,15 +1334,15 @@ def find_additional_dependencies(project: pathlib.Path):
13311334
exts = ("lib", "exp")
13321335

13331336
for ext in exts:
1334-
source = outputs_path / ("python37.%s" % ext)
1335-
dest = core_dir / ("python37.%s" % ext)
1337+
source = outputs_path / ("python%s.%s" % (python_majmin, ext))
1338+
dest = core_dir / ("python%s.%s" % (python_majmin, ext))
13361339
log("copying %s" % source)
13371340
shutil.copyfile(source, dest)
13381341

13391342
if static:
1340-
res["core"]["static_lib"] = "build/core/python37.lib"
1343+
res["core"]["static_lib"] = "build/core/python%s.lib" % python_majmin
13411344
else:
1342-
res["core"]["shared_lib"] = "install/python37.dll"
1345+
res["core"]["shared_lib"] = "install/python%s.dll" % python_majmin
13431346

13441347
# We hack up pythoncore.vcxproj and the list in it when this function
13451348
# runs isn't totally accurate. We hardcode the list from the CPython
@@ -1707,6 +1710,7 @@ def build_cpython(python_entry_name: str, arch: str, profile):
17071710
build_info = collect_python_build_artifacts(
17081711
pcbuild_path,
17091712
out_dir / "python",
1713+
"".join(entry["version"].split(".")[0:2]),
17101714
build_directory,
17111715
artifact_config,
17121716
static=static,

0 commit comments

Comments
 (0)