[Zope-Checkins] CVS: Zope3/lib/python/Zope/TAL - TALGenerator.py:1.52.16.3.4.10

Barry Warsaw barry@wooz.org
Mon, 10 Jun 2002 15:50:02 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/TAL
In directory cvs.zope.org:/tmp/cvs-serv11199/lib/python/Zope/TAL

Modified Files:
      Tag: fdrake-tal-i18n-branch
	TALGenerator.py 
Log Message:
emitI18nVariable(): Initialize key and cexpr to None and assert that
key must be either 'text' or None.  I can't imagine why it would be
anything else.


=== Zope3/lib/python/Zope/TAL/TALGenerator.py 1.52.16.3.4.9 => 1.52.16.3.4.10 ===
         # "I live in <span i18n:name="country"
         #                  tal:replace="here/countryOfOrigin" />"
-        key = cexpr = ''
+        key = cexpr = None
         if arg[0] is not None:
             key, expr = parseSubstitution(arg[0])
             cexpr = self.compileExpression(expr)
         else:
             cexpr = self.optimize(arg[1][1:])
         program = self.popProgram()
-        # XXX Would key be anything but `text'?
-        assert key == 'text'
+        # XXX Would key be anything but 'text' or None?
+        assert key in ('text', None)
         self.emit('i18nVariable', varname, cexpr, program)
 
     def emitTranslation(self, msgid):