Mercurial > public > mercurial-scm > hg
diff tests/test-check-code.t @ 17620:efd1a4378b64
check-code: catch yield inside try/finally (with tests)
This is not allowed in Python 2.4.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Wed, 19 Sep 2012 12:29:12 +0200 |
parents | 72803c8edaa4 |
children | c582a71457e5 |
line wrap: on
line diff
--- a/tests/test-check-code.t Tue Sep 18 16:30:21 2012 -0700 +++ b/tests/test-check-code.t Wed Sep 19 12:29:12 2012 +0200 @@ -43,6 +43,19 @@ > pass > 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 <<EOF > class newstyle_class(object): @@ -84,6 +97,12 @@ ./non-py24.py:11: > try: no try/except/finally in Python 2.4 + ./non-py24.py:28: + > try: + no yield inside try/finally in Python 2.4 + ./non-py24.py:33: + > try: + no yield inside try/finally in Python 2.4 ./classstyle.py:4: > class oldstyle_class: old-style class, use class foo(object)