summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-11-09 19:01:44 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-11-09 19:01:44 (GMT)
commit838a359b958d7dfd0556d993e97d803be9767e7e (patch)
tree5cc62e28ba922e995857ddc6832e68a2336ea483 /Lib
parent5f26dda25d80d33dd9d2cf646778c30fd94de10c (diff)
downloadcpython-838a359b958d7dfd0556d993e97d803be9767e7e.zip
cpython-838a359b958d7dfd0556d993e97d803be9767e7e.tar.gz
cpython-838a359b958d7dfd0556d993e97d803be9767e7e.tar.bz2
Search for tix subdirectories. Fixes #564729. Will backport to 2.2.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/lib-tk/FixTk.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/Lib/lib-tk/FixTk.py b/Lib/lib-tk/FixTk.py
index 765e639..a7801a2 100644
--- a/Lib/lib-tk/FixTk.py
+++ b/Lib/lib-tk/FixTk.py
@@ -19,14 +19,19 @@ if os.path.exists(prefix):
tcldir = os.path.join(prefix,name)
if os.path.isdir(tcldir):
os.environ["TCL_LIBRARY"] = tcldir
- # Now set the other variables accordingly
+ # Compute TK_LIBRARY, knowing that it has the same version
+ # as Tcl
import _tkinter
ver = str(_tkinter.TCL_VERSION)
- for t in "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
+ if not os.environ.has_key("TK_LIBRARY"):
+ v = os.path.join(prefix, 'tk'+ver)
+ if os.path.exists(os.path.join(v, "tclIndex")):
+ os.environ['TK_LIBRARY'] = v
+ # We don't know the Tix version, so we must search the entire
+ # directory
+ if not os.environ.has_key("TIX_LIBRARY"):
+ for name in os.listdir(prefix):
+ if name.startswith("tix"):
+ tixdir = os.path.join(prefix,name)
+ if os.path.isdir(tixdir):
+ os.environ["TIX_LIBRARY"] = tixdir