mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
parent
b9279bc88f
commit
790465fd90
21 changed files with 642 additions and 414 deletions
|
|
@ -3012,7 +3012,7 @@ ins_string(PyObject *d, char *name, char *val)
|
|||
PyMODINIT_FUNC
|
||||
init_tkinter(void)
|
||||
{
|
||||
PyObject *m, *d;
|
||||
PyObject *m, *d, *uexe, *cexe;
|
||||
|
||||
Py_TYPE(&Tkapp_Type) = &PyType_Type;
|
||||
|
||||
|
|
@ -3065,7 +3065,16 @@ init_tkinter(void)
|
|||
|
||||
/* This helps the dynamic loader; in Unicode aware Tcl versions
|
||||
it also helps Tcl find its encodings. */
|
||||
Tcl_FindExecutable(Py_GetProgramName());
|
||||
uexe = PyUnicode_FromWideChar(Py_GetProgramName(), -1);
|
||||
if (uexe) {
|
||||
cexe = PyUnicode_AsEncodedString(uexe,
|
||||
Py_FileSystemDefaultEncoding,
|
||||
NULL);
|
||||
if (cexe)
|
||||
Tcl_FindExecutable(PyString_AsString(cexe));
|
||||
Py_XDECREF(cexe);
|
||||
Py_DECREF(uexe);
|
||||
}
|
||||
|
||||
if (PyErr_Occurred())
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue