Wiking branch, master, updated. c510a03d94f12163f4250f32df62731e45b9d244

Milan Zamazal pdm at devel.brailcom.org
Thu Oct 21 18:50:19 CEST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Wiking".

The branch, master has been updated
       via  c510a03d94f12163f4250f32df62731e45b9d244 (commit)
      from  7c3096e0905bd991385a6ea1b3a5c49604a62b71 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c510a03d94f12163f4250f32df62731e45b9d244
Author: Milan Zamazal <pdm at brailcom.org>
Date:   Thu Oct 21 18:49:15 2010 +0200

    Protect link cache against unshashable keys

-----------------------------------------------------------------------

Summary of changes:
 lib/wiking/db.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/lib/wiking/db.py b/lib/wiking/db.py
index 310bed3..5718072 100644
--- a/lib/wiking/db.py
+++ b/lib/wiking/db.py
@@ -1239,8 +1239,11 @@ class PytisModule(Module, ActionHandler):
                 cache_key = tuple(key.items())
             else:
                 cache_key = key
-            if self._link_cache.has_key(cache_key):
-                return self._link_cache[cache_key]
+            try:
+                if self._link_cache.has_key(cache_key):
+                    return self._link_cache[cache_key]
+            except TypeError:           # catch unhashable keys
+                pass
             # TODO: The following is an important optimization hack.  It is an
             # incorrect hack because if a successor redefines _record_uri
             # method, the redefined method doesn't get called.  At least we
@@ -1266,7 +1269,10 @@ class PytisModule(Module, ActionHandler):
         else:
             result = None
         if not args and not kwargs:
-            self._link_cache[cache_key] = result
+            try:
+                self._link_cache[cache_key] = result
+            except TypeError:           # catch unhashable keys
+                pass
         return result
         
     def related(self, req, binding, record, uri):


hooks/post-receive
-- 
Wiking



More information about the Wiking-cvs mailing list