[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py Merged r68414 from 2.10 branch:

Florent Guillaume fg at nuxeo.com
Wed May 31 14:00:30 EDT 2006


Log message for revision 68415:
  Merged r68414 from 2.10 branch:
  There must be no warning when __name__ is supplied.
  

Changed:
  U   Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py

-=-
Modified: Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
===================================================================
--- Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py	2006-05-31 17:59:21 UTC (rev 68414)
+++ Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py	2006-05-31 18:00:30 UTC (rev 68415)
@@ -59,15 +59,13 @@
     _default_bindings = {'name_subpath': 'traverse_subpath'}
 
     def __init__(self, filename, _prefix=None, **kw):
-        name = None
-        if kw.has_key('__name__'):
-            name = kw['__name__']
-            del kw['__name__'] 
+        name = kw.pop('__name__', None)
 
         basepath, ext = os.path.splitext(filename)
 
         if name:
             self.id = self.__name__ = name
+            self._need__name__ = 0
         else:
             self.id = self.__name__ = os.path.basename(basepath)
 



More information about the Zope-Checkins mailing list