]> granicus.if.org Git - python/commitdiff
Suggestion from SF patch #470433 to avoid clobbering TCL_LIBRARY et
authorGuido van Rossum <guido@python.org>
Fri, 12 Oct 2001 15:34:29 +0000 (15:34 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 12 Oct 2001 15:34:29 +0000 (15:34 +0000)
al. if already set.  Also adds TIX_LIBRARY (just in case).
(Note that this is entirely Windows specific.)

Lib/lib-tk/FixTk.py

index c0af29b542a4ffd25cede48ee78b326e631f8d5b..029e7cd103ee379f0c910adb912e07aa5311861d 100644 (file)
@@ -1,6 +1,11 @@
 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
+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