3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 11:42:51 +01:00

DeprecatedAttributesObject: don't clobber __ variables

This commit is contained in:
James Lu 2017-06-30 21:38:50 -07:00
parent a73300e864
commit 6d7e2c667d

View File

@ -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)))