correct error handling for retrieving file modification date

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3469 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-07-22 07:29:10 +00:00
parent 3d4092fe44
commit 9c7ad26306

View file

@ -97,7 +97,12 @@ class MediaAsset(MediaAssetFile, ExternalFileAdapter):
if not d:
dp = self.getDataPath()
if dp is not None:
return datetime.fromtimestamp(os.path.getmtime(dp))
try:
return datetime.fromtimestamp(os.path.getmtime(dp))
except OSError, e:
getLogger('loops.media.asset.MediaAsset').warn(e)
return None
return d
def setModified(self, value):
self.context._modified = value