mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Deprecate bsddb for removal in Python 3.0.
Closes issue 3776. Review by Nick Coghlan.
This commit is contained in:
parent
6024834ed9
commit
32476fc5a8
8 changed files with 26 additions and 6 deletions
|
|
@ -314,7 +314,14 @@ class WarningsRecorder(list):
|
|||
self.append(WarningMessage(*args, **kwargs))
|
||||
|
||||
def __getattr__(self, attr):
|
||||
return getattr(self[-1], attr)
|
||||
"""Return attributes from the last caught warning, or raise
|
||||
AttributeError."""
|
||||
try:
|
||||
return getattr(self[-1], attr)
|
||||
except IndexError:
|
||||
raise AttributeError("no recorded warning to read "
|
||||
"{0!r} attribute from".format(attr))
|
||||
|
||||
|
||||
def reset(self):
|
||||
del self[:]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue