Changeset 3785:3aa5a5d89287 in livinglogic.python.xist

Show
Ignore:
Timestamp:
06/02/09 17:47:48 (10 years ago)
Author:
Walter Doerwald <walter@…>
Children:
3786:56fb60cd4cef, 3823:697e888115bc
Branch:
default
Tags:
rel-3-6-5
Message:

Fix UL4 templates that produce no output.

As the generated Python sourcecode didn't contain any yield statements, the
resulting function was an ordinary function instead of a generator.

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • NEWS.rst

    r3721 r3785  
     1Changes in 3.6.5 (released 06/02/2009) 
     2-------------------------------------- 
     3 
     4*   Fix UL4 templates that produce no output: As the generated Python sourcecode 
     5    didn't contain any ``yield`` statements, the resulting function was an 
     6    ordinary function instead of a generator. 
     7 
     8 
    19Changes in 3.6.4 (released 03/19/2009) 
    210-------------------------------------- 
  • setup.py

    r3720 r3785  
    201201args = dict( 
    202202    name="ll-xist", 
    203     version="3.6.4", 
     203    version="3.6.5", 
    204204    description="Extensible HTML/XML generator, cross-platform templating language and various other tools", 
    205205    long_description=descr, 
  • src/ll/ul4c.py

    r3716 r3785  
    11991199        self.lines.append("%ssource = %r" % (self.indent, self.source)) 
    12001200        self.lines.append('%svariables = dict((key.decode("utf-8"), value) for (key, value) in variables.iteritems())' % self.indent) # FIXME: This can be dropped in Python 3.0 where strings are unicode 
     1201        # Make sure that the resulting code is a generator even if the byte codes produces no yield statement 
     1202        self.lines.append("%sif 0: yield ''" % self.indent) 
    12011203        locations = [] 
    12021204        lines2locs = []