Skip to content

Commit

Permalink
Using self.self all over the place.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Feb 21, 2019
1 parent 01bf917 commit 9ccec9d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/DocumentTemplate/_DocumentTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ class InstanceDict(Base):
guarded_getattr = None

def __init__(self, inst, namespace, guarded_getattr=None):
self.inst = inst
self.self = inst
self.namespace = namespace
self.cache = {}
Expand All @@ -283,7 +282,7 @@ def __init__(self, inst, namespace, guarded_getattr=None):
self.guarded_getattr = guarded_getattr

def __repr__(self):
return 'InstanceDict(%r)' % self.inst
return 'InstanceDict(%r)' % self.self

def __len__(self):
return 1
Expand All @@ -300,14 +299,14 @@ def __getitem__(self, key):
if key != '__str__':
raise KeyError(key) # Don't divulge private data
else:
return str(self.inst)
return str(self.self)

get = self.guarded_getattr
if get is None:
get = getattr

try:
result = get(self.inst, key)
result = get(self.self, key)
except AttributeError:
raise KeyError(key)

Expand Down

0 comments on commit 9ccec9d

Please sign in to comment.