bpo-47061: deprecate the aifc module (GH-32134)

Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
Brett Cannon 2022-04-05 12:05:48 -07:00 committed by GitHub
parent 944f09adfc
commit c1d93b6411
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 95 additions and 6 deletions

View file

@ -1,10 +1,18 @@
import contextlib
import functools
import importlib
import re
import sys
import warnings
def import_deprecated(name):
"""Import *name* while suppressing DeprecationWarning."""
with warnings.catch_warnings():
warnings.simplefilter('ignore', category=DeprecationWarning)
return importlib.import_module(name)
def check_syntax_warning(testcase, statement, errtext='',
*, lineno=1, offset=None):
# Test also that a warning is emitted only once.