Changeset 3847:539005662bd0 in livinglogic.python.xist

Show
Ignore:
Timestamp:
07/31/09 15:54:51 (10 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Make sure that nested templates are generators too, even if they are empty.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/ul4c.py

    r3787 r3847  
    10021002        self._pythonsource_line(opcode.location, "try:") 
    10031003        self.indent += 1 
     1004        # Make sure that the resulting code is a generator even if the byte codes produce no yield statement 
     1005        self._pythonsource_line(opcode.location, "if 0: yield ''") 
    10041006    def _pythonsource_dispatch_enddef(self, opcode): 
    10051007        defopcode = self.defs.pop() 
     
    11381140                self.lastopcode = opcode.code 
    11391141        except Exception, exc: 
    1140             raise #Error(opcode.location, exc) 
     1142            raise Error(opcode.location, exc) 
    11411143        self.indent -= 1 
    11421144        self._pythonsource_line(self.lastlocation, "except Exception, exc:")