From: Tomas Babej Date: Thu, 24 Dec 2015 12:35:47 +0000 (+0100) Subject: LazyUUIDTaskSet: Do not replace when accessing __attributes X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/f4c62d864c32af08fcd4e359ffe3fbaf10d6a9bb?ds=inline LazyUUIDTaskSet: Do not replace when accessing __attributes --- diff --git a/tasklib/lazy.py b/tasklib/lazy.py index 0bd9332..0050547 100644 --- a/tasklib/lazy.py +++ b/tasklib/lazy.py @@ -66,8 +66,14 @@ class LazyUUIDTaskSet(object): def __getattr__(self, name): # Getattr is called only if the attribute could not be found using # normal means - self.replace() - return self.name + + if name.startswith('__'): + # If some internal method was being search, do not convert + # to TaskQuerySet just because of that + raise AttributeError + else: + self.replace() + return self.name def __eq__(self, other): return set(t['uuid'] for t in other) == self._uuids