diff options
author | Guido van Rossum <guido@python.org> | 2001-10-12 15:34:29 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-10-12 15:34:29 (GMT) |
commit | ea32cbb24e24472f290f7575e494caacd1bfbe05 (patch) | |
tree | ed298a705355437421ebd1ecdbacd754dde89bba /Lib | |
parent | 5af588b7f0509b79645bc8652c4af038a4bd82ce (diff) | |
download | cpython-ea32cbb24e24472f290f7575e494caacd1bfbe05.zip cpython-ea32cbb24e24472f290f7575e494caacd1bfbe05.tar.gz cpython-ea32cbb24e24472f290f7575e494caacd1bfbe05.tar.bz2 |
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.)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/lib-tk/FixTk.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Lib/lib-tk/FixTk.py b/Lib/lib-tk/FixTk.py index c0af29b..029e7cd 100644 --- a/Lib/lib-tk/FixTk.py +++ b/Lib/lib-tk/FixTk.py @@ -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 |