diff options
author | pjenvey <devnull@localhost> | 2006-08-03 00:51:35 +0000 |
---|---|---|
committer | pjenvey <devnull@localhost> | 2006-08-03 00:51:35 +0000 |
commit | 2a861e5d626e382c5b2eee50dfd49cf1381379b5 (patch) | |
tree | 6a2dad2e7e230472cfb7d228686c8e80f883bbaf /paste/registry.py | |
parent | 45a5adb9e393a140dfc2fb465d683648322842a6 (diff) | |
download | paste-2a861e5d626e382c5b2eee50dfd49cf1381379b5.tar.gz |
having StackedObjectProxy.__repr__ avoid raising an exception when it
does not contain an internal object
Diffstat (limited to 'paste/registry.py')
-rw-r--r-- | paste/registry.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/paste/registry.py b/paste/registry.py index ae9775c..a802856 100644 --- a/paste/registry.py +++ b/paste/registry.py @@ -132,7 +132,12 @@ class StackedObjectProxy(object): self.current_obj().__delitem__(key) def __repr__(self): - return self.current_obj().__repr__() + try: + return self.current_obj().__repr__() + except TypeError: + return '<%s.%s object at 0x%08x>' % (__name__, + self.__class__.__name__, + id(self)) def __iter__(self): """Only works for proxying to a dict""" |