work around the risk of catching an unrelated TypeError stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 26 Jun 2009 11:50:22 +0200
branchstable
changeset 2171 b0c564c86a4b
parent 2169 124fb0b9fa4b
child 2176 1ae46634bf8e
work around the risk of catching an unrelated TypeError
web/views/primary.py
--- a/web/views/primary.py	Fri Jun 26 11:31:57 2009 +0200
+++ b/web/views/primary.py	Fri Jun 26 11:50:22 2009 +0200
@@ -57,7 +57,9 @@
         self.content_navigation_components('navcontenttop')
         try:
             self.render_entity_attributes(entity)
-        except TypeError: # XXX bw compat
+        except TypeError, e: # XXX bw compat
+            if 'render_entity' not in e.args[0]:
+                raise
             warn('siderelations argument of render_entity_attributes is '
                  'deprecated (%s)' % self.__class__)
             self.render_entity_attributes(entity, [])
@@ -66,6 +68,8 @@
             try:
                 self.render_entity_relations(entity)
             except TypeError: # XXX bw compat
+                if 'render_entity' not in e.args[0]:
+                    raise
                 warn('siderelations argument of render_entity_relations is '
                      'deprecated')
                 self.render_entity_relations(entity, [])