Skip to content

Commit

Permalink
bpo-41282: Consistent message and filter warning in setup.py (GH-25571)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Heimes <christian@python.org>
  • Loading branch information
tiran authored Apr 24, 2021
1 parent c8666cf commit a460ab3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Lib/distutils/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a460ab3

Please sign in to comment.