summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--six.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/six.py b/six.py
index 4252fdf..0df4538 100644
--- a/six.py
+++ b/six.py
@@ -88,8 +88,12 @@ class _LazyDescr(object):
def __get__(self, obj, tp):
result = self._resolve()
setattr(obj, self.name, result) # Invokes __set__.
- # This is a bit ugly, but it avoids running this again.
- delattr(obj.__class__, self.name)
+ try:
+ # This is a bit ugly, but it avoids running this again by
+ # removing this descriptor.
+ delattr(obj.__class__, self.name)
+ except AttributeError:
+ pass
return result