From: John Mandereau Date: Fri, 26 Sep 2008 22:33:15 +0000 (+0200) Subject: Python scripts: fail explicitly if Python version < 2.4 X-Git-Tag: release/2.11.61-1~40 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=eda788a9744b27765a6aaa7cc22a7ca08d66c735;p=lilypond.git Python scripts: fail explicitly if Python version < 2.4 This is mainly intended for MacOS GUB binaries. --- diff --git a/python/lilylib.py b/python/lilylib.py index f9cbff2c60..15b654f84c 100644 --- a/python/lilylib.py +++ b/python/lilylib.py @@ -68,6 +68,14 @@ def stderr_write (s): progress = stderr_write +def require_python_version (): + if sys.hexversion < 0x02040000: + stderr_write ("Python 2.4 or newer is required to run this program.\n\ +Please upgrade Python from http://python.org/download/, and if you use MacOS X,\n\ +please read installation instructions in Application usage.") + os.system ("open http://python.org/download/") + sys.exit (2) + # Modified version of the commands.mkarg(x), which always uses # double quotes (since Windows can't handle the single quotes: def mkarg(x): diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 9bc0a14005..7affd1bd25 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -21,6 +21,8 @@ import re import lilylib as ly global _;_=ly._ +ly.require_python_version () + import convertrules lilypond_version_re_str = '\\\\version *\"([0-9.]+)"' diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 09fecd1540..be9fef694a 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -45,6 +45,7 @@ import fontextract import langdefs global _;_=ly._ +ly.require_python_version () # Lilylib globals. program_version = '@TOPLEVEL_VERSION@'