Changed __get/setattribute__ calls to get/setattr() calls.
authorW. Trevor King <wking@drexel.edu>
Fri, 14 Nov 2008 05:32:38 +0000 (00:32 -0500)
committerW. Trevor King <wking@drexel.edu>
Fri, 14 Nov 2008 05:32:38 +0000 (00:32 -0500)
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

libbe/bugdir.py

index 427ed38f0192a9b9cc2148d0a959eb07be655f13..bcc163cd5a110193efd8f14fe49c94dedfe236dc 100644 (file)
@@ -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