]> git.donarmstrong.com Git - lilypond.git/commitdiff
convert-ly: Compat code for python 2.4 and 3.0 (named exception handling)
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 26 Feb 2010 21:00:42 +0000 (22:00 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 26 Feb 2010 21:00:42 +0000 (22:00 +0100)
scripts/convert-ly.py

index 5470baef2895526ecfaacd6a6e708af83910b1ae..fd4dc3b8d8affc03d968c79011efc51c8466cbce 100644 (file)
@@ -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')