[adapters compat] make implements_adapter_compat selector compatible with attributes
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 21 May 2010 15:05:44 +0200
changeset 5571 5d024bf9424b
parent 5570 50b887d25233
child 5572 df5551d697e8
[adapters compat] make implements_adapter_compat selector compatible with attributes
view.py
--- a/view.py	Fri May 21 15:04:56 2010 +0200
+++ b/view.py	Fri May 21 15:05:44 2010 +0200
@@ -547,7 +547,10 @@
                      '%s for %s instead' % (func.__name__, iface,
                                             entity.__class__),
                      DeprecationWarning)
-                return getattr(entity, func.__name__)(*args, **kwargs)
+                member = getattr(entity, func.__name__)
+                if callable(member):
+                    return member(*args, **kwargs)
+                return member
             return func(self, *args, **kwargs)
         return decorated
     return _pre39_compat