@@ -615,7 +615,7 @@ Process-wide parameters
615
615
returned string points into static storage; the caller should not modify its
616
616
value. This corresponds to the :makevar: `prefix ` variable in the top-level
617
617
:file: `Makefile ` and the :option: `--prefix ` argument to the :program: `configure `
618
- script at build time. The value is available to Python code as ``sys.prefix ``.
618
+ script at build time. The value is available to Python code as ``sys.base_prefix ``.
619
619
It is only useful on Unix. See also the next function.
620
620
621
621
This function should not be called before :c:func: `Py_Initialize `, otherwise
@@ -625,7 +625,8 @@ Process-wide parameters
625
625
It now returns ``NULL `` if called before :c:func: `Py_Initialize `.
626
626
627
627
.. deprecated-removed :: 3.13 3.15
628
- Get :data: `sys.prefix ` instead.
628
+ Get :data: `sys.base_prefix ` instead, or :data: `sys.prefix ` if
629
+ :ref: `virtual environments <venv-def >` need to be handled.
629
630
630
631
631
632
.. c :function :: wchar_t * Py_GetExecPrefix ()
@@ -638,7 +639,8 @@ Process-wide parameters
638
639
should not modify its value. This corresponds to the :makevar: `exec_prefix `
639
640
variable in the top-level :file: `Makefile ` and the ``--exec-prefix ``
640
641
argument to the :program: `configure ` script at build time. The value is
641
- available to Python code as ``sys.exec_prefix ``. It is only useful on Unix.
642
+ available to Python code as ``sys.base_exec_prefix ``. It is only useful on
643
+ Unix.
642
644
643
645
Background: The exec-prefix differs from the prefix when platform dependent
644
646
files (such as executables and shared libraries) are installed in a different
@@ -669,7 +671,8 @@ Process-wide parameters
669
671
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
670
672
671
673
.. deprecated-removed:: 3.13 3.15
672
- Get :data:`sys.exec_prefix` instead.
674
+ Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if
675
+ :ref:`virtual environments <venv-def>` need to be handled.
673
676
674
677
675
678
.. c:function:: wchar_t* Py_GetProgramFullPath()
0 commit comments