Skip to content

Commit a460ab3

Browse files
authored
bpo-41282: Consistent message and filter warning in setup.py (GH-25571)
Signed-off-by: Christian Heimes <[email protected]>
1 parent c8666cf commit a460ab3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Lib/distutils/sysconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
from sysconfig import _fix_pcbuild
5858

5959
warnings.warn(
60-
'the distutils.sysconfig module is deprecated, use sysconfig instead',
60+
'The distutils.sysconfig module is deprecated, use sysconfig instead',
6161
DeprecationWarning,
6262
stacklevel=2
6363
)

setup.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,16 @@
3333

3434
with warnings.catch_warnings():
3535
# bpo-41282 (PEP 632) deprecated distutils but setup.py still uses it
36-
warnings.filterwarnings("ignore", "The distutils package is deprecated",
37-
DeprecationWarning)
36+
warnings.filterwarnings(
37+
"ignore",
38+
"The distutils package is deprecated",
39+
DeprecationWarning
40+
)
41+
warnings.filterwarnings(
42+
"ignore",
43+
"The distutils.sysconfig module is deprecated, use sysconfig instead",
44+
DeprecationWarning
45+
)
3846

3947
from distutils import log
4048
from distutils.command.build_ext import build_ext

0 commit comments

Comments
 (0)