From: Reinhold Kainhofer Date: Fri, 26 Feb 2010 21:00:42 +0000 (+0100) Subject: convert-ly: Compat code for python 2.4 and 3.0 (named exception handling) X-Git-Tag: release/2.13.14-1~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4a8c5285d1744c89532f95f280badba0842f875a;p=lilypond.git convert-ly: Compat code for python 2.4 and 3.0 (named exception handling) --- diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 5470baef28..fd4dc3b8d8 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -319,10 +319,13 @@ def main (): do_one_file (f) except UnknownVersion: error (_ ("%s: Unable to determine version. Skipping") % f) - except InvalidVersion, ex: + except InvalidVersion: + # Compat code for 2.x and 3.0 syntax ("except .. as v" doesn't + # work in python 2.4!): + t, v, b = sys.exc_info () error (_ ("%s: Invalid version string `%s' \n" "Valid version strings consist of three numbers, " - "separated by dots, e.g. `2.8.12'") % (f, ex.version) ) + "separated by dots, e.g. `2.8.12'") % (f, v.version) ) sys.stderr.write ('\n')