bpo-41282: Consistent message and filter warning in setup.py (GH-25571)

Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
Christian Heimes 2021-04-24 09:55:15 +02:00 committed by GitHub
parent c8666cfa7c
commit a460ab3134
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -57,7 +57,7 @@
from sysconfig import _fix_pcbuild
warnings.warn(
'the distutils.sysconfig module is deprecated, use sysconfig instead',
'The distutils.sysconfig module is deprecated, use sysconfig instead',
DeprecationWarning,
stacklevel=2
)

View File

@ -33,8 +33,16 @@
with warnings.catch_warnings():
# bpo-41282 (PEP 632) deprecated distutils but setup.py still uses it
warnings.filterwarnings("ignore", "The distutils package is deprecated",
DeprecationWarning)
warnings.filterwarnings(
"ignore",
"The distutils package is deprecated",
DeprecationWarning
)
warnings.filterwarnings(
"ignore",
"The distutils.sysconfig module is deprecated, use sysconfig instead",
DeprecationWarning
)
from distutils import log
from distutils.command.build_ext import build_ext