Allow 'continue' inside 'try' clause
SF patch 102989 by Thomas Wouters
diff --git a/Lib/dis.py b/Lib/dis.py
index 269304e..2dcecdb 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -259,6 +259,7 @@
 
 name_op('LOAD_GLOBAL', 116)     # Index in name list
 
+jabs_op('CONTINUE_LOOP', 119)   # Target address
 jrel_op('SETUP_LOOP', 120)      # Distance to target address
 jrel_op('SETUP_EXCEPT', 121)    # ""
 jrel_op('SETUP_FINALLY', 122)   # ""
diff --git a/Lib/test/output/test_exceptions b/Lib/test/output/test_exceptions
index 8ce0154..e1e146a 100644
--- a/Lib/test/output/test_exceptions
+++ b/Lib/test/output/test_exceptions
@@ -27,11 +27,7 @@
 (not used any more?)
 spam
 SyntaxError
-'continue' not supported inside 'try' clause
-ok
-'continue' not supported inside 'try' clause
-ok
-'continue' not supported inside 'try' clause
+'continue' not supported inside 'finally' clause
 ok
 'continue' not properly in loop
 ok
diff --git a/Lib/test/output/test_grammar b/Lib/test/output/test_grammar
index 172a597..319177c 100644
--- a/Lib/test/output/test_grammar
+++ b/Lib/test/output/test_grammar
@@ -33,6 +33,8 @@
 flow_stmt
 break_stmt
 continue_stmt
+continue + try/except ok
+continue + try/finally ok
 return_stmt
 raise_stmt
 import_stmt
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 73c2489..9f42659 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -104,28 +104,11 @@
 s = '''\
 while 1:
     try:
-        continue
-    except:
         pass
-'''
-ckmsg(s, "'continue' not supported inside 'try' clause")
-s = '''\
-while 1:
-    try:
-        continue
     finally:
-        pass
+        continue
 '''
-ckmsg(s, "'continue' not supported inside 'try' clause")
-s = '''\
-while 1:
-    try:
-        if 1:
-            continue
-    finally:
-        pass
-'''
-ckmsg(s, "'continue' not supported inside 'try' clause")
+ckmsg(s, "'continue' not supported inside 'finally' clause")
 s = '''\
 try:
     continue
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 6e0fe91..b7af64a 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -349,6 +349,25 @@
 i = 1
 while i: i = 0; continue
 
+msg = ""
+while not msg:
+    msg = "continue + try/except ok"
+    try:
+        continue
+        msg = "continue failed to continue inside try"
+    except:
+        msg = "continue inside try called except block"
+print msg
+
+msg = ""
+while not msg:
+    msg = "finally block not called"
+    try:
+        continue
+    finally:
+        msg = "continue + try/finally ok"
+print msg
+    
 print 'return_stmt' # 'return' [testlist]
 def g1(): return
 def g2(): return 1