Changeset 3386:1aa8437a6c49 in livinglogic.python.xist

Show
Ignore:
Timestamp:
06/19/08 18:06:22 (11 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Change the xmlescape() function, so that the argument will be converted to a string.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • docs/ULL.rst

    r3384 r3386  
    336336    ``&lt;&apos;foo&apos; &amp; ;&apos;bar&apos&gt;`` 
    337337 
     338If the argument is not a string, it will be converted to a string first. 
     339 
    338340 
    339341``sorted`` 
  • src/ll/ullc.py

    r3385 r3386  
    775775                elif opcode.code == "callfunc1": 
    776776                    if opcode.arg == "xmlescape": 
    777                         yield self._code("reg%d = xmlescape(reg%d)" % (opcode.r1, opcode.r2)) 
     777                        yield self._code("reg%d = xmlescape(unicode(reg%d)) if reg%d is not None else u''" % (opcode.r1, opcode.r2, opcode.r2)) 
    778778                    elif opcode.arg == "str": 
    779779                        yield self._code("reg%d = unicode(reg%d) if reg%d is not None else u''" % (opcode.r1, opcode.r2, opcode.r2))