changeset 1127:d6f19f62f44f

Merge with main
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Thu, 03 Aug 2006 22:06:18 +0200
parents 0f5d10f9b31b (current diff) fd05b2dc86a4 (diff)
children 52b85612832f
files
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Thu Aug 03 22:02:20 2006 +0200
+++ b/MoinMoin/Page.py	Thu Aug 03 22:06:18 2006 +0200
@@ -12,6 +12,10 @@
 from MoinMoin.logfile import eventlog
 from MoinMoin.util import filesys, timefuncs
 
+def is_cache_exception(e):
+    args = e.args
+    return not (len(args) != 1 or args[0] != 'CacheNeedsUpdate')
+
 class Page:
     """Page - Manage an (immutable) page associated with a WikiName.
        To change a page's content, use the PageEditor class.
@@ -1361,13 +1365,13 @@
                 code = self.loadCache(request)
                 self.execute(request, parser, code)
             except Exception, e:
-                if getattr(e, "message", None) != 'CacheNeedsUpdate':
+                if not is_cache_exception(e):
                     raise
                 try:
                     code = self.makeCache(request, parser)
                     self.execute(request, parser, code)
                 except Exception, e:
-                    if getattr(e, "message", None) != 'CacheNeedsUpdate':
+                    if not is_cache_exception(e):
                         raise
                     request.log('page cache failed after creation')
                     self.format(parser)