check-code: drop try/except/finally check
authorMatt Mackall <mpm@selenic.com>
Fri, 15 May 2015 09:54:35 -0500
changeset 25077 68633ff2b608
parent 25076 14bf7679fb68
child 25078 e8348f1cc228
check-code: drop try/except/finally check
contrib/check-code.py
tests/test-check-code.t
--- a/contrib/check-code.py	Thu May 14 09:04:48 2015 +0200
+++ b/contrib/check-code.py	Fri May 15 09:54:35 2015 -0500
@@ -217,9 +217,6 @@
     (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'(?<!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.*?'
--- a/tests/test-check-code.t	Thu May 14 09:04:48 2015 +0200
+++ b/tests/test-check-code.t	Fri May 15 09:54:35 2015 -0500
@@ -104,9 +104,6 @@
   ./non-py24.py:6:
    >     z = next(x)
    no next(foo) in Python 2.4 and 2.5, use foo.next() instead
-  ./non-py24.py:18:
-   >     try:
-   no try/except/finally in Python 2.4
   ./non-py24.py:35:
    >     try:
    no yield inside try/finally in Python 2.4