check-code: catch "except as"
authorMatt Mackall <mpm@selenic.com>
Thu, 16 Dec 2010 14:50:36 -0600
changeset 13160 07d08c130892
parent 13159 3172da69ff37
child 13161 11eb53464e68
check-code: catch "except as"
contrib/check-code.py
mercurial/subrepo.py
--- a/contrib/check-code.py	Thu Dec 16 14:50:27 2010 -0600
+++ b/contrib/check-code.py	Thu Dec 16 14:50:36 2010 -0600
@@ -129,6 +129,7 @@
     (r'[\x80-\xff]', "non-ASCII character literal"),
     (r'("\')\.format\(', "str.format() not available in Python 2.4"),
     (r'^\s*with\s+', "with not available in Python 2.4"),
+    (r'^\s*except.* as .*:', "except as not available in Python 2.4"),
     (r'(?<!def)\s+(any|all|format)\(',
      "any/all/format not available in Python 2.4"),
     (r'(?<!def)\s+(callable)\(',
--- a/mercurial/subrepo.py	Thu Dec 16 14:50:27 2010 -0600
+++ b/mercurial/subrepo.py	Thu Dec 16 14:50:36 2010 -0600
@@ -21,7 +21,7 @@
             for l in ctx['.hgsubstate'].data().splitlines():
                 revision, path = l.split(" ", 1)
                 rev[path] = revision
-        except IOError as err:
+        except IOError, err:
             if err.errno != errno.ENOENT:
                 raise
     return rev