Search for tix subdirectories. Fixes #564729. Will backport to 2.2.

This commit is contained in:
Martin v. Löwis 2002-11-09 19:01:44 +00:00
parent 5f26dda25d
commit 838a359b95
1 changed files with 14 additions and 9 deletions

View File

@ -19,14 +19,19 @@ if os.path.exists(prefix):
tcldir = os.path.join(prefix,name) tcldir = os.path.join(prefix,name)
if os.path.isdir(tcldir): if os.path.isdir(tcldir):
os.environ["TCL_LIBRARY"] = 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 import _tkinter
ver = str(_tkinter.TCL_VERSION) ver = str(_tkinter.TCL_VERSION)
for t in "tk", "tix": if not os.environ.has_key("TK_LIBRARY"):
key = t.upper() + "_LIBRARY" v = os.path.join(prefix, 'tk'+ver)
try: if os.path.exists(os.path.join(v, "tclIndex")):
v = os.environ[key] os.environ['TK_LIBRARY'] = v
except KeyError: # We don't know the Tix version, so we must search the entire
v = os.path.join(sys.prefix, "tcl", t+ver) # directory
if os.path.exists(os.path.join(v, "tclIndex")): if not os.environ.has_key("TIX_LIBRARY"):
os.environ[key] = v 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