Commit 838a359b authored by Martin v. Löwis's avatar Martin v. Löwis

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

parent 5f26dda2
...@@ -19,14 +19,19 @@ if os.path.exists(prefix): ...@@ -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:
v = os.environ[key]
except KeyError:
v = os.path.join(sys.prefix, "tcl", t+ver)
if os.path.exists(os.path.join(v, "tclIndex")): if os.path.exists(os.path.join(v, "tclIndex")):
os.environ[key] = v 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment