[Python-checkins] CVS: python/dist/src/Lib/lib-tk FixTk.py,1.4,1.5
Guido van Rossum
gvanrossum@users.sourceforge.net
Fri, 12 Oct 2001 08:34:31 -0700
Update of /cvsroot/python/python/dist/src/Lib/lib-tk
In directory usw-pr-cvs1:/tmp/cvs-serv10506
Modified Files:
FixTk.py
Log Message:
Suggestion from SF patch #470433 to avoid clobbering TCL_LIBRARY et
al. if already set. Also adds TIX_LIBRARY (just in case).
(Note that this is entirely Windows specific.)
Index: FixTk.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/FixTk.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FixTk.py 2000/10/25 17:42:13 1.4
--- FixTk.py 2001/10/12 15:34:29 1.5
***************
*** 1,6 ****
import sys, os, _tkinter
ver = str(_tkinter.TCL_VERSION)
! for t in "tcl", "tk":
! v = os.path.join(sys.prefix, "tcl", t+ver)
! if os.path.exists(os.path.join(v, "tclIndex")):
! os.environ[t.upper() + "_LIBRARY"] = v
--- 1,11 ----
import sys, os, _tkinter
+
ver = str(_tkinter.TCL_VERSION)
! for t in "tcl", "tk", "tix":
! key = t.upper() + "_LIBRARY"
! try:
! v = os.environ[key]
! except KeyError:
! v = os.path.join(sys.prefix, "tcl", t+ver)
! if os.path.exists(os.path.join(v, "tclIndex")):
! os.environ[key] = v