Skip to content

Commit

Permalink
bpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206)
Browse files Browse the repository at this point in the history
https://bugs.python.org/issue38823
(cherry picked from commit 289cf0f)

Co-authored-by: Brandt Bucher <[email protected]>
  • Loading branch information
miss-islington and brandtbucher authored Nov 18, 2019
1 parent bef2815 commit 42a4359
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 @@ -3549,11 +3549,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 42a4359

Please sign in to comment.