Skip to content

Commit 50a37fb

Browse files
committed
Catch warnings in stdlib
1 parent e2c0326 commit 50a37fb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Lib/sysconfig/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ def get_default_scheme():
325325

326326
def get_makefile_filename():
327327
"""Return the path of the Makefile."""
328+
import warnings
328329

329330
# GH-127429: When cross-compiling, use the Makefile from the target, instead of the host Python.
330331
if cross_base := os.environ.get('_PYTHON_PROJECT_BASE'):
@@ -333,7 +334,11 @@ def get_makefile_filename():
333334
if _PYTHON_BUILD:
334335
return os.path.join(_PROJECT_BASE, "Makefile")
335336

336-
if hasattr(sys, 'abiflags'):
337+
with warnings.catch_warnings():
338+
warnings.simplefilter('ignore', DeprecationWarning)
339+
has_abiflags = hasattr(sys, 'abiflags')
340+
341+
if has_abiflags:
337342
config_dir_name = f'config-{_PY_VERSION_SHORT}{sys.abiflags}'
338343
else:
339344
config_dir_name = 'config'

0 commit comments

Comments
 (0)