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.)
This commit is contained in:
parent
5af588b7f0
commit
ea32cbb24e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue