From: Martin v. Löwis Date: Sat, 9 Nov 2002 19:02:34 +0000 (+0000) Subject: Search for tix subdirectories. Fixes #564729. X-Git-Tag: v2.2.3c1~241 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ba5d4b9de0a9e348f709deb6bb5d4595937ba3a;p=thirdparty%2FPython%2Fcpython.git Search for tix subdirectories. Fixes #564729. --- diff --git a/Lib/lib-tk/FixTk.py b/Lib/lib-tk/FixTk.py index 765e639bbb65..a7801a250723 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