diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -216,8 +216,9 @@ pypats = [ (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'(?