mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-125313: Prefer sys.base_*
paths in Py_Get(Exec)Prefix
deprecation notes (#125317)
Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes. Signed-off-by: y5c4l3 <y5c4l3@proton.me>
This commit is contained in:
parent
ded105a62b
commit
7d88140d52
2 changed files with 9 additions and 6 deletions
|
@ -625,7 +625,7 @@ Process-wide parameters
|
||||||
returned string points into static storage; the caller should not modify its
|
returned string points into static storage; the caller should not modify its
|
||||||
value. This corresponds to the :makevar:`prefix` variable in the top-level
|
value. This corresponds to the :makevar:`prefix` variable in the top-level
|
||||||
:file:`Makefile` and the :option:`--prefix` argument to the :program:`configure`
|
:file:`Makefile` and the :option:`--prefix` argument to the :program:`configure`
|
||||||
script at build time. The value is available to Python code as ``sys.prefix``.
|
script at build time. The value is available to Python code as ``sys.base_prefix``.
|
||||||
It is only useful on Unix. See also the next function.
|
It is only useful on Unix. See also the next function.
|
||||||
|
|
||||||
This function should not be called before :c:func:`Py_Initialize`, otherwise
|
This function should not be called before :c:func:`Py_Initialize`, otherwise
|
||||||
|
@ -635,7 +635,8 @@ Process-wide parameters
|
||||||
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
|
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.13 3.15
|
.. deprecated-removed:: 3.13 3.15
|
||||||
Get :data:`sys.prefix` instead.
|
Get :data:`sys.base_prefix` instead, or :data:`sys.prefix` if
|
||||||
|
:ref:`virtual environments <venv-def>` need to be handled.
|
||||||
|
|
||||||
|
|
||||||
.. c:function:: wchar_t* Py_GetExecPrefix()
|
.. c:function:: wchar_t* Py_GetExecPrefix()
|
||||||
|
@ -648,7 +649,8 @@ Process-wide parameters
|
||||||
should not modify its value. This corresponds to the :makevar:`exec_prefix`
|
should not modify its value. This corresponds to the :makevar:`exec_prefix`
|
||||||
variable in the top-level :file:`Makefile` and the ``--exec-prefix``
|
variable in the top-level :file:`Makefile` and the ``--exec-prefix``
|
||||||
argument to the :program:`configure` script at build time. The value is
|
argument to the :program:`configure` script at build time. The value is
|
||||||
available to Python code as ``sys.exec_prefix``. It is only useful on Unix.
|
available to Python code as ``sys.base_exec_prefix``. It is only useful on
|
||||||
|
Unix.
|
||||||
|
|
||||||
Background: The exec-prefix differs from the prefix when platform dependent
|
Background: The exec-prefix differs from the prefix when platform dependent
|
||||||
files (such as executables and shared libraries) are installed in a different
|
files (such as executables and shared libraries) are installed in a different
|
||||||
|
@ -679,7 +681,8 @@ Process-wide parameters
|
||||||
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
|
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.13 3.15
|
.. deprecated-removed:: 3.13 3.15
|
||||||
Get :data:`sys.exec_prefix` instead.
|
Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if
|
||||||
|
:ref:`virtual environments <venv-def>` need to be handled.
|
||||||
|
|
||||||
|
|
||||||
.. c:function:: wchar_t* Py_GetProgramFullPath()
|
.. c:function:: wchar_t* Py_GetProgramFullPath()
|
||||||
|
|
|
@ -13,11 +13,11 @@ Pending removal in Python 3.15
|
||||||
* :c:func:`PySys_ResetWarnOptions`:
|
* :c:func:`PySys_ResetWarnOptions`:
|
||||||
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
|
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
|
||||||
* :c:func:`Py_GetExecPrefix`:
|
* :c:func:`Py_GetExecPrefix`:
|
||||||
Get :data:`sys.exec_prefix` instead.
|
Get :data:`sys.base_exec_prefix` and :data:`sys.exec_prefix` instead.
|
||||||
* :c:func:`Py_GetPath`:
|
* :c:func:`Py_GetPath`:
|
||||||
Get :data:`sys.path` instead.
|
Get :data:`sys.path` instead.
|
||||||
* :c:func:`Py_GetPrefix`:
|
* :c:func:`Py_GetPrefix`:
|
||||||
Get :data:`sys.prefix` instead.
|
Get :data:`sys.base_prefix` and :data:`sys.prefix` instead.
|
||||||
* :c:func:`Py_GetProgramFullPath`:
|
* :c:func:`Py_GetProgramFullPath`:
|
||||||
Get :data:`sys.executable` instead.
|
Get :data:`sys.executable` instead.
|
||||||
* :c:func:`Py_GetProgramName`:
|
* :c:func:`Py_GetProgramName`:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue