From 6d7e2c667d461d6a57d0958ae9b9e8cd4b385bce Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 30 Jun 2017 21:38:50 -0700 Subject: [PATCH] DeprecatedAttributesObject: don't clobber __ variables --- utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 1e47b30..0526889 100644 --- a/utils.py +++ b/utils.py @@ -582,7 +582,8 @@ class DeprecatedAttributesObject(): def __getattribute__(self, attr): # Note: "self.deprecated_attributes" calls this too, so the != check is # needed to prevent a recursive loop! - if attr != 'deprecated_attributes' and attr in self.deprecated_attributes: + # Also ignore reserved names beginning with "__". + if attr != 'deprecated_attributes' and not attr.startswith('__') and attr in self.deprecated_attributes: log.warning('Attribute %s.%s is deprecated: %s' % (self.__class__.__name__, attr, self.deprecated_attributes.get(attr)))