Issue 19760: Deprecation warnings in ttest_sysconfig and test_distutils (original) (raw)

Following warnings are emitted when ttest_sysconfig and test_distutils ran with -Wall:

$ ./python -Wall -m test.regrtest test_sysconfig test_distutils [1/2] test_sysconfig /home/serhiy/py/cpython/Lib/sysconfig.py:588: DeprecationWarning: SO is deprecated, use EXT_SUFFIX warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning) [2/2] test_distutils /home/serhiy/py/cpython/Lib/distutils/sysconfig.py:578: DeprecationWarning: SO is deprecated, use EXT_SUFFIX warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning) unknown, 0: Warning: using regular magic file /etc/magic' unknown, 0: Warning: using regular magic file /etc/magic' All 2 tests OK.

The proposed patch silences deprecation warnings. It also changes warning stacklevel for the 'SO' key in sysconfig to 2 so a warning now reports about place where stdlib function is called instead a place in the stdlib.