Reduce the mix of python versions in configure.py in case of running it with python3

This commit is contained in:
Stephan Witt 2021-12-31 13:40:22 +01:00
parent 6372f5569e
commit 77670bc998

View File

@ -1293,7 +1293,7 @@ def checkConverterEntries():
if lilypond_book: if lilypond_book:
found_lilypond_book = False found_lilypond_book = False
# On Windows, the file lilypond-book is not directly callable, it must be passed as argument to python. # On Windows, the file lilypond-book is not directly callable, it must be passed as argument to python.
for cmd in ["lilypond-book", "python \"" + path + "/lilypond-book\""]: for cmd in ["lilypond-book", os.path.basename(sys.executable) + ' "' + path + '/lilypond-book"']:
version_string = cmdOutput(cmd + " --version") version_string = cmdOutput(cmd + " --version")
if len(version_string) == 0: if len(version_string) == 0:
continue continue
@ -1331,9 +1331,8 @@ def checkConverterEntries():
logger.info('+ found LilyPond-book version %s.' % version_number) logger.info('+ found LilyPond-book version %s.' % version_number)
# early exit on first match, avoid 2nd try with problematic python call # early exit on first match, avoid 2nd try with python call
# 1) in case of configure.py called with "python3" hardcoded "python" call is wrong # in case of lilypond-book being an executable or shell script the python call is useless
# 2) in case of lilypond-book being an executable or shell script the python call is useless
break break
else: else:
logger.info('+ found LilyPond-book, but version %s is too old.' % version_number) logger.info('+ found LilyPond-book, but version %s is too old.' % version_number)