@@ -575,7 +575,7 @@ def _get_expected_config(self):
575
575
return configs
576
576
577
577
def get_expected_config (self , expected_preconfig , expected ,
578
- env , api , modify_path_cb = None ):
578
+ env , api , modify_path_cb = None , cwd = None ):
579
579
configs = self ._get_expected_config ()
580
580
581
581
pre_config = configs ['pre_config' ]
@@ -618,6 +618,14 @@ def get_expected_config(self, expected_preconfig, expected,
618
618
expected ['base_executable' ] = default_executable
619
619
if expected ['program_name' ] is self .GET_DEFAULT_CONFIG :
620
620
expected ['program_name' ] = './_testembed'
621
+ if MS_WINDOWS :
622
+ # follow the calculation in getpath.py
623
+ tmpname = expected ['program_name' ] + '.exe'
624
+ if cwd :
625
+ tmpname = os .path .join (cwd , tmpname )
626
+ if os .path .isfile (tmpname ):
627
+ expected ['program_name' ] += '.exe'
628
+ del tmpname
621
629
622
630
config = configs ['config' ]
623
631
for key , value in expected .items ():
@@ -711,7 +719,7 @@ def check_all_configs(self, testname, expected_config=None,
711
719
self .get_expected_config (expected_preconfig ,
712
720
expected_config ,
713
721
env ,
714
- api , modify_path_cb )
722
+ api , modify_path_cb , cwd )
715
723
716
724
out , err = self .run_embedded_interpreter (testname ,
717
725
env = env , cwd = cwd )
0 commit comments