[pypy-svn] r18010 - pypy/dist/pypy/interpreter/astcompiler

ac at codespeak.net ac at codespeak.net
Fri Sep 30 17:26:25 CEST 2005


Author: ac
Date: Fri Sep 30 17:26:25 2005
New Revision: 18010

Modified:
   pypy/dist/pypy/interpreter/astcompiler/pycodegen.py
Log:
Oops!

Modified: pypy/dist/pypy/interpreter/astcompiler/pycodegen.py
==============================================================================
--- pypy/dist/pypy/interpreter/astcompiler/pycodegen.py	(original)
+++ pypy/dist/pypy/interpreter/astcompiler/pycodegen.py	Fri Sep 30 17:26:25 2005
@@ -1012,11 +1012,12 @@
         self.emit('RETURN_VALUE')
 
     def visitYield(self, node):
-        kind, block = self.setups.top()
-        if kind  == TRY_FINALLY:
-            raise SyntaxError("'yield' not allowed in a 'try' block "
-                              "with a 'finally' clause",
-                              node.lineno)
+        if self.setups:
+            kind, block = self.setups.top()
+            if kind  == TRY_FINALLY:
+                raise SyntaxError("'yield' not allowed in a 'try' block "
+                                  "with a 'finally' clause",
+                                  node.lineno)
         self.set_lineno(node)
         node.value.accept( self )
         self.emit('YIELD_VALUE')



More information about the Pypy-commit mailing list