From: W. Trevor King Date: Fri, 14 Nov 2008 05:32:38 +0000 (-0500) Subject: Changed __get/setattribute__ calls to get/setattr() calls. X-Git-Tag: 1.0.0~168 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=91b284cde8c4443cf0997798f4f847ce95409cd3;p=be.git Changed __get/setattribute__ calls to get/setattr() calls. See http://www.python.org/doc/2.5.2/lib/built-in-funcs.html#l2h-33 http://www.python.org/doc/2.5.2/lib/built-in-funcs.html#l2h-66 --- diff --git a/libbe/bugdir.py b/libbe/bugdir.py index 427ed38..bcc163c 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -198,7 +198,7 @@ class InvalidValue(Exception): def checked_property(name, valid): def getter(self): - value = self.__getattribute__("_"+name) + value = getattr(self, "_"+name) if value not in valid: raise InvalidValue(name, value) return value @@ -206,7 +206,7 @@ def checked_property(name, valid): def setter(self, value): if value not in valid: raise InvalidValue(name, value) - return self.__setattr__("_"+name, value) + return setattr(self, "_"+name, value) return property(getter, setter) severity_levels = ("wishlist", "minor", "serious", "critical", "fatal") @@ -254,7 +254,7 @@ class Bug(object): active = property(_get_active) def add_attr(self, map, name): - value = self.__getattribute__(name) + value = getattr(self, name) if value is not None: map[name] = value @@ -336,7 +336,7 @@ def add_attrs(obj, map, names, map_names=None): map_names[name] = name for name in names: - value = obj.__getattribute__(name) + value = getattr(obj, name) if value is not None: map[map_names[name]] = value