mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
[3.13] GH-92897: schedule the check_home deprecation to 3.15 (GH-129102) (#130583)
Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
This commit is contained in:
parent
676cecac1c
commit
4100fb0537
5 changed files with 37 additions and 5 deletions
|
|
@ -55,6 +55,11 @@ Pending Removal in Python 3.15
|
|||
This function is only useful for Jython support, has a confusing API,
|
||||
and is largely untested.
|
||||
|
||||
* :mod:`sysconfig`:
|
||||
|
||||
* The *check_home* argument of :func:`sysconfig.is_python_build` has been
|
||||
deprecated since Python 3.12.
|
||||
|
||||
* :mod:`threading`:
|
||||
|
||||
* :func:`~threading.RLock` will take no arguments in Python 3.15.
|
||||
|
|
|
|||
|
|
@ -105,9 +105,6 @@ although there is currently no date scheduled for their removal.
|
|||
* ``ssl.TLSVersion.TLSv1``
|
||||
* ``ssl.TLSVersion.TLSv1_1``
|
||||
|
||||
* :func:`sysconfig.is_python_build` *check_home* parameter is deprecated and
|
||||
ignored.
|
||||
|
||||
* :mod:`threading` methods:
|
||||
|
||||
* :meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition.notify_all`.
|
||||
|
|
|
|||
|
|
@ -220,8 +220,15 @@ def _safe_realpath(path):
|
|||
def is_python_build(check_home=None):
|
||||
if check_home is not None:
|
||||
import warnings
|
||||
warnings.warn("check_home argument is deprecated and ignored.",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
warnings.warn(
|
||||
(
|
||||
'The check_home argument of sysconfig.is_python_build is '
|
||||
'deprecated and its value is ignored. '
|
||||
'It will be removed in Python 3.15.'
|
||||
),
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
for fn in ("Setup", "Setup.local"):
|
||||
if os.path.isfile(os.path.join(_PROJECT_BASE, "Modules", fn)):
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -689,5 +689,26 @@ def test_parse_makefile(self):
|
|||
})
|
||||
|
||||
|
||||
class DeprecationTests(unittest.TestCase):
|
||||
def deprecated(self, removal_version, deprecation_msg=None, error=Exception, error_msg=None):
|
||||
if sys.version_info >= removal_version:
|
||||
return self.assertRaises(error, msg=error_msg)
|
||||
else:
|
||||
return self.assertWarns(DeprecationWarning, msg=deprecation_msg)
|
||||
|
||||
def test_is_python_build_check_home(self):
|
||||
with self.deprecated(
|
||||
removal_version=(3, 15),
|
||||
deprecation_msg=(
|
||||
'The check_home argument of sysconfig.is_python_build is '
|
||||
'deprecated and its value is ignored. '
|
||||
'It will be removed in Python 3.15.'
|
||||
),
|
||||
error=TypeError,
|
||||
error_msg="is_python_build() takes 0 positional arguments but 1 were given",
|
||||
):
|
||||
sysconfig.is_python_build('foo')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
Scheduled the deprecation of the ``check_home`` argument of
|
||||
:func:`sysconfig.is_python_build` to Python 3.15.
|
||||
Loading…
Add table
Add a link
Reference in a new issue