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