Commit 54e270fb authored by Steve Alexander's avatar Steve Alexander

fixed unqualified except: clause, and logic that was using

hasattr(self, '_v_program') rather than self._v_program is not None.
parent 1d623fd3
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
Zope object encapsulating a Page Template from the filesystem. Zope object encapsulating a Page Template from the filesystem.
""" """
__version__='$Revision: 1.15 $'[11:-2] __version__='$Revision: 1.16 $'[11:-2]
import os, AccessControl, Acquisition, sys import os, AccessControl, Acquisition, sys
from Globals import package_home, DevelopmentMode from Globals import package_home, DevelopmentMode
...@@ -107,9 +107,11 @@ class PageTemplateFile(Script, PageTemplate, Traversable): ...@@ -107,9 +107,11 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
if self._v_last_read and not DevelopmentMode: if self._v_last_read and not DevelopmentMode:
return return
__traceback_info__ = self.filename __traceback_info__ = self.filename
try: mtime=os.stat(self.filename)[8] try:
except: mtime=0 mtime = os.path.getmtime(self.filename)
if hasattr(self, '_v_program') and mtime == self._v_last_read: except OSError:
mtime = 0
if self._v_program is not None and mtime == self._v_last_read:
return return
self.pt_edit(open(self.filename), None) self.pt_edit(open(self.filename), None)
self._cook() self._cook()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment