mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Remove test.test_support.guard_warnings_filter.
test.test_support.catch_warning is more full-featured and provides the same functionality. Since guard_warnings_filter was added in 2.6 there is no backwards-compatibility issues.
This commit is contained in:
parent
be7abbb9d9
commit
2ee4128e9b
10 changed files with 18 additions and 32 deletions
|
@ -271,14 +271,6 @@ def open_urlresource(url):
|
|||
fn, _ = urllib.urlretrieve(url, filename)
|
||||
return open(fn)
|
||||
|
||||
@contextlib.contextmanager
|
||||
def guard_warnings_filter():
|
||||
"""Guard the warnings filter from being permanently changed."""
|
||||
original_filters = warnings.filters[:]
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
warnings.filters = original_filters
|
||||
|
||||
class WarningMessage(object):
|
||||
"Holds the result of the latest showwarning() call"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue