contrib/check-code.py
changeset 22175 2965804483e3
parent 22101 6fa40bd78bc8
child 22448 8afaf7cef35a
--- a/contrib/check-code.py	Thu Aug 14 16:39:02 2014 -0500
+++ b/contrib/check-code.py	Thu Aug 14 16:39:27 2014 -0500
@@ -216,8 +216,9 @@
     (r'(\w|\)),\w', "missing whitespace after ,"),
     (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"),
     (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"),
-    (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n'
-     r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Python 2.4'),
+    (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)(\1except.*?:\n'
+     r'((?:\n|\1\s.*\n)+?))+\1finally:',
+     'no try/except/finally in Python 2.4'),
     (r'(?<!def)(\s+|^|\()next\(.+\)',
      'no next(foo) in Python 2.4 and 2.5, use foo.next() instead'),
     (r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?'