@@ -344,6 +344,7 @@ def setup_python(self, context):
344344            exename  =  os .path .basename (context .env_exe )
345345            exe_stem  =  os .path .splitext (exename )[0 ]
346346            exe_d  =  '_d'  if  os .path .normcase (exe_stem ).endswith ('_d' ) else  '' 
347+             current_exename  =  os .path .basename (sys .executable )
347348            if  sysconfig .is_python_build ():
348349                scripts  =  dirname 
349350            else :
@@ -355,6 +356,7 @@ def setup_python(self, context):
355356                link_sources  =  {
356357                    'python.exe' : python_exe ,
357358                    f'python{ exe_d }  : python_exe ,
359+                     current_exename : python_exe ,
358360                    'pythonw.exe' : pythonw_exe ,
359361                    f'pythonw{ exe_d }  : pythonw_exe ,
360362                }
@@ -363,6 +365,7 @@ def setup_python(self, context):
363365                copy_sources  =  {
364366                    'python.exe' : python_exe ,
365367                    f'python{ exe_d }  : python_exe ,
368+                     current_exename : python_exe ,
366369                    'pythonw.exe' : pythonw_exe ,
367370                    f'pythonw{ exe_d }  : pythonw_exe ,
368371                }
@@ -375,6 +378,7 @@ def setup_python(self, context):
375378                    f'python{ exe_d }  : python_exe ,
376379                    f'python{ exe_t }  : python_exe ,
377380                    f'python{ exe_t } { exe_d }  : python_exe ,
381+                     current_exename : python_exe ,
378382                    'pythonw.exe' : pythonw_exe ,
379383                    f'pythonw{ exe_d }  : pythonw_exe ,
380384                    f'pythonw{ exe_t }  : pythonw_exe ,
@@ -387,6 +391,7 @@ def setup_python(self, context):
387391                    f'python{ exe_d }  : python_exe ,
388392                    f'python{ exe_t }  : python_exe ,
389393                    f'python{ exe_t } { exe_d }  : python_exe ,
394+                     current_exename : python_exe ,
390395                    'pythonw.exe' : pythonw_exe ,
391396                    f'pythonw{ exe_d }  : pythonw_exe ,
392397                    f'pythonw{ exe_t }  : pythonw_exe ,
0 commit comments