Skip to content

Commit

Permalink
bpo-38823: Clean up refleaks in _tkinter initialization. (pythonGH-17206
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher authored and miss-islington committed Nov 18, 2019
1 parent 5383956 commit 289cf0f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Modules/_tkinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -3555,11 +3555,13 @@ PyInit__tkinter(void)
if (!ret && GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
str_path = _get_tcl_lib_path();
if (str_path == NULL && PyErr_Occurred()) {
Py_DECREF(m);
return NULL;
}
if (str_path != NULL) {
wcs_path = PyUnicode_AsWideCharString(str_path, NULL);
if (wcs_path == NULL) {
Py_DECREF(m);
return NULL;
}
SetEnvironmentVariableW(L"TCL_LIBRARY", wcs_path);
Expand Down

0 comments on commit 289cf0f

Please sign in to comment.