changeset 1126:fd05b2dc86a4

Now it even works on Python < 2.5
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Thu, 03 Aug 2006 22:05:12 +0200
parents 0719653ce4fb
children d6f19f62f44f 34abcbba032d
files MoinMoin/Page.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Thu Aug 03 21:35:34 2006 +0200
+++ b/MoinMoin/Page.py	Thu Aug 03 22:05:12 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)