diff options
-rw-r--r-- | pyflakes/checker.py | 2 | ||||
-rw-r--r-- | pyflakes/test/test_other.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/pyflakes/checker.py b/pyflakes/checker.py index eca2002..c8ccf56 100644 --- a/pyflakes/checker.py +++ b/pyflakes/checker.py @@ -1738,7 +1738,7 @@ class Checker(object): break # Handle Try/TryFinally difference in Python < and >= 3.3 if hasattr(n, 'finalbody') and isinstance(node, ast.Continue): - if n_child in n.finalbody: + if n_child in n.finalbody and not PY38_PLUS: self.report(messages.ContinueInFinally, node) return if isinstance(node, ast.Continue): diff --git a/pyflakes/test/test_other.py b/pyflakes/test/test_other.py index df2f790..282accb 100644 --- a/pyflakes/test/test_other.py +++ b/pyflakes/test/test_other.py @@ -493,8 +493,10 @@ class Test(TestCase): continue ''') + @skipIf(version_info > (3, 8), "Python <= 3.8 only") def test_continueInFinally(self): # 'continue' inside 'finally' is a special syntax error + # that is removed in 3.8 self.flakes(''' while True: try: @@ -2003,6 +2005,7 @@ class TestAsyncStatements(TestCase): ''', m.BreakOutsideLoop) @skipIf(version_info < (3, 5), 'new in Python 3.5') + @skipIf(version_info > (3, 8), "Python <= 3.8 only") def test_continueInAsyncForFinally(self): self.flakes(''' async def read_data(db): |