[Zope-Checkins] CVS: Zope/lib/python/Products/PageTemplates - PageTemplateFile.py:1.16

Steve Alexander steve@cat-box.net
Thu, 18 Jul 2002 12:10:18 -0400


Update of /cvs-repository/Zope/lib/python/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv21096

Modified Files:
	PageTemplateFile.py 
Log Message:
fixed unqualified except: clause, and logic that was using 
hasattr(self, '_v_program') rather than self._v_program is not None.



=== Zope/lib/python/Products/PageTemplates/PageTemplateFile.py 1.15 => 1.16 ===
         if self._v_last_read and not DevelopmentMode:
             return
         __traceback_info__ = self.filename
-        try:    mtime=os.stat(self.filename)[8]
-        except: mtime=0
-        if hasattr(self, '_v_program') and mtime == self._v_last_read:
+        try:
+            mtime = os.path.getmtime(self.filename)
+        except OSError:
+            mtime = 0
+        if self._v_program is not None and mtime == self._v_last_read:
             return
         self.pt_edit(open(self.filename), None)
         self._cook()