Serhiy Storchaka added the comment:
It works in usual circumstances.
>>> import warnings
>>> with warnings.catch_warnings(record=True) as w:
... warnings.simplefilter('always')
... warnings.warn('a test warning', DeprecationWarning)
... print(w)
...
[<warnings.WarningMessage object at 0xb6f1714c>]
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28897>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com