summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-01 07:14:02 (GMT)
committerGitHub <noreply@github.com>2023-06-01 07:14:02 (GMT)
commit424049cc1117d66dfa86196ee5f694c15b46ac6c (patch)
tree92dbbd5558deb687efb53e653d667ba6af608930 /Python/sysmodule.c
parent8ed705c083e8e5ff37649d998a8b1524ec921519 (diff)
downloadcpython-424049cc1117d66dfa86196ee5f694c15b46ac6c.zip
cpython-424049cc1117d66dfa86196ee5f694c15b46ac6c.tar.gz
cpython-424049cc1117d66dfa86196ee5f694c15b46ac6c.tar.bz2
gh-105145: Remove old functions to config Python init (#105154)
Remove the following old functions to configure the Python initialization, deprecated in Python 3.11: * PySys_AddWarnOptionUnicode() * PySys_AddWarnOption() * PySys_AddXOption() * PySys_HasWarnOptions() * PySys_SetArgvEx() * PySys_SetArgv() * PySys_SetPath() * Py_SetPath() * Py_SetProgramName() * Py_SetPythonHome() * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Most of these functions are kept in the stable ABI, except: * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Update Doc/extending/embedding.rst and Doc/extending/extending.rst to use the new PyConfig API. _testembed.c: * check_stdio_details() now sets stdio_encoding and stdio_errors of PyConfig. * Add definitions of functions removed from the API but kept in the stable ABI. * test_init_from_config() and test_init_read_set() now use PyConfig_SetString() instead of PyConfig_SetBytesString(). Remove _Py_ClearStandardStreamEncoding() internal function.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 32be7ec..4427e73 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2614,7 +2614,8 @@ _PySys_AddWarnOptionWithError(PyThreadState *tstate, PyObject *option)
return 0;
}
-void
+// Removed in Python 3.13 API, but kept for the stable ABI
+PyAPI_FUNC(void)
PySys_AddWarnOptionUnicode(PyObject *option)
{
PyThreadState *tstate = _PyThreadState_GET();
@@ -2626,7 +2627,8 @@ PySys_AddWarnOptionUnicode(PyObject *option)
}
}
-void
+// Removed in Python 3.13 API, but kept for the stable ABI
+PyAPI_FUNC(void)
PySys_AddWarnOption(const wchar_t *s)
{
PyThreadState *tstate = _PyThreadState_GET();
@@ -2645,7 +2647,8 @@ _Py_COMP_DIAG_POP
Py_DECREF(unicode);
}
-int
+// Removed in Python 3.13 API, but kept for the stable ABI
+PyAPI_FUNC(int)
PySys_HasWarnOptions(void)
{
PyThreadState *tstate = _PyThreadState_GET();
@@ -2718,7 +2721,8 @@ error:
return -1;
}
-void
+// Removed in Python 3.13 API, but kept for the stable ABI
+PyAPI_FUNC(void)
PySys_AddXOption(const wchar_t *s)
{
PyThreadState *tstate = _PyThreadState_GET();
@@ -3621,7 +3625,8 @@ makepathobject(const wchar_t *path, wchar_t delim)
return v;
}
-void
+// Removed in Python 3.13 API, but kept for the stable ABI
+PyAPI_FUNC(void)
PySys_SetPath(const wchar_t *path)
{
PyObject *v;
@@ -3653,7 +3658,8 @@ make_sys_argv(int argc, wchar_t * const * argv)
return list;
}
-void
+// Removed in Python 3.13 API, but kept for the stable ABI
+PyAPI_FUNC(void)
PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath)
{
wchar_t* empty_argv[1] = {L""};
@@ -3697,7 +3703,8 @@ PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath)
}
}
-void
+// Removed in Python 3.13 API, but kept for the stable ABI
+PyAPI_FUNC(void)
PySys_SetArgv(int argc, wchar_t **argv)
{
_Py_COMP_DIAG_PUSH