Skip to content

Commit ccfc91b

Browse files
committed
pythongh-112984: Fix link error on free-threaded Windows build
The test_peg_generator test tried to link the python313_d.lib library, which failed because the library is now named python313t_d.lib. The underlying problem is that the "compiler" attribute was not set when we call get_libraries() from distutils.
1 parent 1d7bddd commit ccfc91b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Tools/peg_generator/pegen/build.py

+3
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ def compile_c_extension(
220220
)
221221
else:
222222
objects = compiler.object_filenames(extension.sources, output_dir=cmd.build_temp)
223+
# The cmd.get_libraries() call needs a valid compiler attribute or we will
224+
# get an incorrect library name on the free-threaded Windows build.
225+
cmd.compiler = compiler
223226
# Now link the object files together into a "shared object"
224227
compiler.link_shared_object(
225228
objects,

0 commit comments

Comments
 (0)