◐ Shell
clean mode source ↗

Message 123615 - Python tracker

I think this happens because 

1. test___all__.py imports tkinter module, and it
   imports tkinter/_fix.py
2. _fix.py sets TCL_LIBRARY etc as top level routine
3. regrtest.py resets os.environ after test___all__.py ends.
   so TCL_LIBRARY gone.
4. test_tcl.py tries to import tkinter module, but it won't
   be loaded twice, so TCL_LIBRARY won't be set.
5. tcl/tk cannot find its library

I think this can be fixed by save & restore sys.modules
before & after each tests, so that tkinter module can be
loaded again.