mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-105145: Deprecate Py_GetPath() function (#105179)
Deprecate old Python initialization functions: * PySys_ResetWarnOptions() * Py_GetExecPrefix() * Py_GetPath() * Py_GetPrefix() * Py_GetProgramFullPath() * Py_GetProgramName() * Py_GetPythonHome() _tkinter.c uses sys.executable instead of Py_GetProgramName() and uses sys.prefix instead of Py_GetPrefix().
This commit is contained in:
parent
ec0082ca46
commit
c67121ac6b
7 changed files with 57 additions and 12 deletions
|
@ -130,11 +130,10 @@ _get_tcl_lib_path(void)
|
|||
static int already_checked = 0;
|
||||
|
||||
if (already_checked == 0) {
|
||||
PyObject *prefix;
|
||||
struct stat stat_buf;
|
||||
int stat_return_value;
|
||||
|
||||
prefix = PyUnicode_FromWideChar(Py_GetPrefix(), -1);
|
||||
PyObject *prefix = PySys_GetObject("prefix"); // borrowed reference
|
||||
if (prefix == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -3289,8 +3288,8 @@ PyInit__tkinter(void)
|
|||
|
||||
/* This helps the dynamic loader; in Unicode aware Tcl versions
|
||||
it also helps Tcl find its encodings. */
|
||||
uexe = PyUnicode_FromWideChar(Py_GetProgramName(), -1);
|
||||
if (uexe) {
|
||||
uexe = PySys_GetObject("executable"); // borrowed reference
|
||||
if (uexe && PyUnicode_Check(uexe)) { // sys.executable can be None
|
||||
cexe = PyUnicode_EncodeFSDefault(uexe);
|
||||
if (cexe) {
|
||||
#ifdef MS_WINDOWS
|
||||
|
@ -3329,7 +3328,6 @@ PyInit__tkinter(void)
|
|||
#endif /* MS_WINDOWS */
|
||||
}
|
||||
Py_XDECREF(cexe);
|
||||
Py_DECREF(uexe);
|
||||
}
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue