@@ -277,6 +277,14 @@ pub(crate) fn create(
277277 let targetw = scripts. join ( WindowsExecutable :: Pythonw . exe ( interpreter) ) ;
278278 create_link_to_executable ( targetw. as_path ( ) , & executable_target)
279279 . map_err ( Error :: Python ) ?;
280+ if interpreter. gil_disabled ( ) {
281+ let targett = scripts. join ( WindowsExecutable :: PythonMajorMinort . exe ( interpreter) ) ;
282+ create_link_to_executable ( targett. as_path ( ) , & executable_target)
283+ . map_err ( Error :: Python ) ?;
284+ let targetwt = scripts. join ( WindowsExecutable :: PythonwMajorMinort . exe ( interpreter) ) ;
285+ create_link_to_executable ( targetwt. as_path ( ) , & executable_target)
286+ . map_err ( Error :: Python ) ?;
287+ }
280288 } else {
281289 // Always copy `python.exe`.
282290 copy_launcher_windows (
@@ -373,6 +381,24 @@ pub(crate) fn create(
373381 & scripts,
374382 python_home,
375383 ) ?;
384+
385+ // If the GIL is disabled, copy `venvlaunchert.exe` and `venvwlaunchert.exe`.
386+ if interpreter. gil_disabled ( ) {
387+ copy_launcher_windows (
388+ WindowsExecutable :: PythonMajorMinort ,
389+ interpreter,
390+ & base_python,
391+ & scripts,
392+ python_home,
393+ ) ?;
394+ copy_launcher_windows (
395+ WindowsExecutable :: PythonwMajorMinort ,
396+ interpreter,
397+ & base_python,
398+ & scripts,
399+ python_home,
400+ ) ?;
401+ }
376402 }
377403 }
378404 }
@@ -590,8 +616,12 @@ enum WindowsExecutable {
590616 PythonMajor ,
591617 /// The `python3.<minor>.exe` executable (or `venvlauncher.exe` launcher shim).
592618 PythonMajorMinor ,
619+ /// The `python3.<minor>t.exe` executable (or `venvlaunchert.exe` launcher shim).
620+ PythonMajorMinort ,
593621 /// The `pythonw.exe` executable (or `venvwlauncher.exe` launcher shim).
594622 Pythonw ,
623+ /// The `pythonw3.<minor>t.exe` executable (or `venvwlaunchert.exe` launcher shim).
624+ PythonwMajorMinort ,
595625 /// The `pypy.exe` executable.
596626 PyPy ,
597627 /// The `pypy3.exe` executable.
@@ -602,7 +632,7 @@ enum WindowsExecutable {
602632 PyPyw ,
603633 /// The `pypy3.<minor>w.exe` executable.
604634 PyPyMajorMinorw ,
605- // The `graalpy.exe` executable
635+ /// The `graalpy.exe` executable.
606636 GraalPy ,
607637}
608638
@@ -621,7 +651,21 @@ impl WindowsExecutable {
621651 interpreter. python_minor( )
622652 )
623653 }
654+ WindowsExecutable :: PythonMajorMinort => {
655+ format ! (
656+ "python{}.{}t.exe" ,
657+ interpreter. python_major( ) ,
658+ interpreter. python_minor( )
659+ )
660+ }
624661 WindowsExecutable :: Pythonw => String :: from ( "pythonw.exe" ) ,
662+ WindowsExecutable :: PythonwMajorMinort => {
663+ format ! (
664+ "pythonw{}.{}t.exe" ,
665+ interpreter. python_major( ) ,
666+ interpreter. python_minor( )
667+ )
668+ }
625669 WindowsExecutable :: PyPy => String :: from ( "pypy.exe" ) ,
626670 WindowsExecutable :: PyPyMajor => {
627671 format ! ( "pypy{}.exe" , interpreter. python_major( ) )
@@ -656,6 +700,8 @@ impl WindowsExecutable {
656700 Self :: Python | Self :: PythonMajor | Self :: PythonMajorMinor => "venvlauncher.exe" ,
657701 Self :: Pythonw if interpreter. gil_disabled ( ) => "venvwlaunchert.exe" ,
658702 Self :: Pythonw => "venvwlauncher.exe" ,
703+ Self :: PythonMajorMinort => "venvlaunchert.exe" ,
704+ Self :: PythonwMajorMinort => "venvwlaunchert.exe" ,
659705 // From 3.13 on these should replace the `python.exe` and `pythonw.exe` shims.
660706 // These are not relevant as of now for PyPy as it doesn't yet support Python 3.13.
661707 Self :: PyPy | Self :: PyPyMajor | Self :: PyPyMajorMinor => "venvlauncher.exe" ,
0 commit comments