Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f085a16

Browse files
committed
Issue #25456: Fix test_idle when Tcl/Tk DLLs are loaded from python.exe's home
rather than from elsewhere on PATH.
1 parent d9dbf49 commit f085a16

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Lib/test/test_idle.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import unittest
2-
from test import support
3-
from test.support import import_module
2+
from test.support import import_module, import_fresh_module
43

54
# Skip test if _thread or _tkinter wasn't built or idlelib was deleted.
65
import_module('threading') # imported by PyShell, imports _thread
76
tk = import_module('tkinter') # imports _tkinter
87
idletest = import_module('idlelib.idle_test')
8+
# Make sure TCL_LIBRARY is set properly on Windows. Note that this will
9+
# cause a warning about test_idle modifying the environment
10+
import_fresh_module('tkinter._fix')
911

1012
# Without test_main present, regrtest.runtest_inner (line1219) calls
1113
# unittest.TestLoader().loadTestsFromModule(this_module) which calls

0 commit comments

Comments
 (0)