has been deprecated since Python 3.13.
Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable instead.
+* :mod:`sysconfig`:
+
+ * The ``~sysconfig.expand_makefile_vars`` function
+ has been deprecated since Python 3.14.
+ Use the ``vars`` argument of :func:`sysconfig.get_paths` instead.
+
* :mod:`tarfile`:
* The undocumented and unused :attr:`!TarFile.tarfile` attribute
variable expansions; if 'vars' is the output of 'parse_makefile()',
you're fine. Returns a variable-expanded version of 's'.
"""
+
+ import warnings
+ warnings.warn(
+ 'sysconfig.expand_makefile_vars is deprecated and will be removed in '
+ 'Python 3.16. Use sysconfig.get_paths(vars=...) instead.',
+ DeprecationWarning,
+ stacklevel=2,
+ )
+
import re
_findvar1_rx = r"\$\(([A-Za-z][A-Za-z0-9_]*)\)"
})
+class DeprecationTests(unittest.TestCase):
+ def deprecated(self, removal_version, deprecation_msg=None, attribute_msg=None):
+ if sys.version_info >= removal_version:
+ return self.assertRaises(AttributeError, msg=attribute_msg)
+ else:
+ return self.assertWarns(DeprecationWarning, msg=deprecation_msg)
+
+ def test_expand_makefile_vars(self):
+ with self.deprecated(
+ removal_version=(3, 16),
+ deprecation_msg=(
+ 'sysconfig.expand_makefile_vars is deprecated and will be removed in '
+ 'Python 3.16. Use sysconfig.get_paths(vars=...) instead.',
+ ),
+ attribute_msg="module 'sysconfig' has no attribute 'expand_makefile_vars'",
+ ):
+ sysconfig.expand_makefile_vars('', {})
+
+
if __name__ == "__main__":
unittest.main()