# HG changeset patch # User Pierre-Yves David # Date 1431971819 18000 # Node ID ebc41dae840abd1b46e0682a2380b145d17bd1c1 # Parent c3459555318e49088f9b7c781e74cceaba6e737c check-code: drop the yield inside try/finally ban This is now possible with Python 2.6. diff -r c3459555318e -r ebc41dae840a contrib/check-code.py --- a/contrib/check-code.py Mon May 18 15:34:42 2015 -0400 +++ b/contrib/check-code.py Mon May 18 12:56:59 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)*?)\1\s*yield\b.*?' - r'((?:\n|\1\s.*\n)+?)\1finally:', - 'no yield inside try/finally in Python 2.4'), (r'.{81}', "line too long"), (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'), (r'[^\n]\Z', "no trailing newline"), diff -r c3459555318e -r ebc41dae840a tests/test-check-code.t --- a/tests/test-check-code.t Mon May 18 15:34:42 2015 -0400 +++ b/tests/test-check-code.t Mon May 18 12:56:59 2015 -0500 @@ -39,18 +39,6 @@ > finally: > pass > - > # yield inside a try/finally block is not allowed in Python 2.4 - > try: - > pass - > yield 1 - > finally: - > pass - > try: - > yield - > pass - > finally: - > pass - > > EOF $ cat > classstyle.py < class newstyle_class(object): @@ -83,12 +71,6 @@ ./non-py24.py:3: > y = format(x) format not available in Python 2.4 - ./non-py24.py:23: - > try: - no yield inside try/finally in Python 2.4 - ./non-py24.py:28: - > try: - no yield inside try/finally in Python 2.4 ./classstyle.py:4: > class oldstyle_class: old-style class, use class foo(object)