From 1c9ce872815ebcad0c6d67f9e445cca71e5be5b0 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Thu, 19 Apr 2007 16:03:19 +0000 Subject: [PATCH] Use getattr instead of hasattr. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14132 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5SyncML/Subscription.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product/ERP5SyncML/Subscription.py b/product/ERP5SyncML/Subscription.py index 7b768a2efd..b1f8e18bfa 100644 --- a/product/ERP5SyncML/Subscription.py +++ b/product/ERP5SyncML/Subscription.py @@ -861,7 +861,7 @@ class Subscription(Folder, SyncCode): LOG('getGidFromObject gid_generator',0,'is callable') o_gid=gid_gen(object) LOG('getGidFromObject',0,'o_gid: %s' % repr(o_gid)) - elif hasattr(o_base, gid_gen): + elif getattr(o_base, gid_gen, None) is not None: LOG('getGidFromObject',0,'there is the gid generator on o_base') generator = getattr(object, gid_gen) o_gid = generator() @@ -945,7 +945,7 @@ class Subscription(Folder, SyncCode): new_id = None if callable(id_generator): new_id = id_generator(object,gid=gid) - elif hasattr(o_base, id_generator): + elif getattr(o_base, id_generator, None) is not None: generator = getattr(object, id_generator) new_id = generator() else: -- 2.30.9