From 25ed57d47620917f1a5bf044975238fc31299f93 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sat, 23 Jun 2018 00:54:02 +0000 Subject: [PATCH 69/69] Python 3 preparation: avoid assigning to instance __getitem__ in TruthDict. --- roundup/support.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roundup/support.py b/roundup/support.py index 5934cc4..09f9add 100644 --- a/roundup/support.py +++ b/roundup/support.py @@ -15,11 +15,12 @@ class TruthDict: self.keys = {} for col in keys: self.keys[col] = 1 - else: - self.__getitem__ = lambda name: 1 def __getitem__(self, name): - return name in self.keys + if hasattr(self, 'keys'): + return name in self.keys + else: + return True def ensureParentsExist(dest): if not os.path.exists(os.path.dirname(dest)): -- 2.7.4