@@ -630,7 +630,7 @@ def _get_expected_config(self):
630
630
return configs
631
631
632
632
def get_expected_config (self , expected_preconfig , expected ,
633
- env , api , modify_path_cb = None , cwd = None ):
633
+ env , api , modify_path_cb = None ):
634
634
configs = self ._get_expected_config ()
635
635
636
636
pre_config = configs ['pre_config' ]
@@ -673,14 +673,6 @@ def get_expected_config(self, expected_preconfig, expected,
673
673
expected ['base_executable' ] = default_executable
674
674
if expected ['program_name' ] is self .GET_DEFAULT_CONFIG :
675
675
expected ['program_name' ] = './_testembed'
676
- if MS_WINDOWS :
677
- # follow the calculation in getpath.py
678
- tmpname = expected ['program_name' ] + '.exe'
679
- if cwd :
680
- tmpname = os .path .join (cwd , tmpname )
681
- if os .path .isfile (tmpname ):
682
- expected ['program_name' ] += '.exe'
683
- del tmpname
684
676
685
677
config = configs ['config' ]
686
678
for key , value in expected .items ():
@@ -710,6 +702,11 @@ def check_pre_config(self, configs, expected):
710
702
711
703
def check_config (self , configs , expected ):
712
704
config = dict (configs ['config' ])
705
+ if MS_WINDOWS :
706
+ value = config .get (key := 'program_name' )
707
+ if value and isinstance (value , str ):
708
+ ext = '_d.exe' if debug_build (sys .executable ) else '.exe'
709
+ config [key ] = value [:len (value .lower ().removesuffix (ext ))]
713
710
for key , value in list (expected .items ()):
714
711
if value is self .IGNORE_CONFIG :
715
712
config .pop (key , None )
@@ -774,7 +771,7 @@ def check_all_configs(self, testname, expected_config=None,
774
771
self .get_expected_config (expected_preconfig ,
775
772
expected_config ,
776
773
env ,
777
- api , modify_path_cb , cwd )
774
+ api , modify_path_cb )
778
775
779
776
out , err = self .run_embedded_interpreter (testname ,
780
777
env = env , cwd = cwd )
0 commit comments