File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1738,7 +1738,7 @@ def CONTINUE(self, node):
1738
1738
break
1739
1739
# Handle Try/TryFinally difference in Python < and >= 3.3
1740
1740
if hasattr (n , 'finalbody' ) and isinstance (node , ast .Continue ):
1741
- if n_child in n .finalbody :
1741
+ if n_child in n .finalbody and not PY38_PLUS :
1742
1742
self .report (messages .ContinueInFinally , node )
1743
1743
return
1744
1744
if isinstance (node , ast .Continue ):
Original file line number Diff line number Diff line change @@ -493,8 +493,10 @@ def test_continueInsideLoop(self):
493
493
continue
494
494
''' )
495
495
496
+ @skipIf (version_info > (3 , 8 ), "Python <= 3.8 only" )
496
497
def test_continueInFinally (self ):
497
498
# 'continue' inside 'finally' is a special syntax error
499
+ # that is removed in 3.8
498
500
self .flakes ('''
499
501
while True:
500
502
try:
@@ -2003,6 +2005,7 @@ async def read_data(db):
2003
2005
''' , m .BreakOutsideLoop )
2004
2006
2005
2007
@skipIf (version_info < (3 , 5 ), 'new in Python 3.5' )
2008
+ @skipIf (version_info > (3 , 8 ), "Python <= 3.8 only" )
2006
2009
def test_continueInAsyncForFinally (self ):
2007
2010
self .flakes ('''
2008
2011
async def read_data(db):
You can’t perform that action at this time.
0 commit comments