##// END OF EJS Templates
run-tests: fix python executable detection and copy on Windows
Patrick Mezard -
r14335:220f3103 default
parent child Browse files
Show More
@@ -316,7 +316,7 b' def findprogram(program):'
316 316 """Search PATH for a executable program"""
317 317 for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
318 318 name = os.path.join(p, program)
319 if os.access(name, os.X_OK):
319 if os.name == 'nt' or os.access(name, os.X_OK):
320 320 return name
321 321 return None
322 322
@@ -366,12 +366,14 b' def usecorrectpython():'
366 366 # some tests run python interpreter. they must use same
367 367 # interpreter we use or bad things will happen.
368 368 exedir, exename = os.path.split(sys.executable)
369 if exename == 'python':
370 path = findprogram('python')
369 if exename in ('python', 'python.exe'):
370 path = findprogram(exename)
371 371 if os.path.dirname(path) == exedir:
372 372 return
373 else:
374 exename = 'python'
373 375 vlog('# Making python executable in test path use correct Python')
374 mypython = os.path.join(BINDIR, 'python')
376 mypython = os.path.join(BINDIR, exename)
375 377 try:
376 378 os.symlink(sys.executable, mypython)
377 379 except AttributeError:
General Comments 0
You need to be logged in to leave comments. Login now