Skip to content

Commit 069c21d

Browse files
committed
search in more paths for tcl/tkConfig.sh
location of the files changed in tcl/tk package 8.5.9-2
1 parent a50874b commit 069c21d

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

setupext.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -827,15 +827,20 @@ def query_tcltk():
827827
return TCL_TK_CACHE
828828

829829
def parse_tcl_config(tcl_lib_dir, tk_lib_dir):
830-
# This is where they live on Ubuntu Hardy (at least)
831-
tcl_config = os.path.join(tcl_lib_dir, "tclConfig.sh")
832-
tk_config = os.path.join(tk_lib_dir, "tkConfig.sh")
830+
import Tkinter
831+
tcl_poss = [tcl_lib_dir,
832+
"/usr/lib/tcl"+str(Tkinter.TclVersion),
833+
"/usr/lib"]
834+
tk_poss = [tk_lib_dir,
835+
"/usr/lib/tk"+str(Tkinter.TkVersion),
836+
"/usr/lib"]
837+
for ptcl, ptk in zip(tcl_poss, tk_poss):
838+
tcl_config = os.path.join(ptcl, "tclConfig.sh")
839+
tk_config = os.path.join(ptk, "tkConfig.sh")
840+
if (os.path.exists(tcl_config) and os.path.exists(tk_config)):
841+
break
833842
if not (os.path.exists(tcl_config) and os.path.exists(tk_config)):
834-
# This is where they live on RHEL4 (at least)
835-
tcl_config = "/usr/lib/tclConfig.sh"
836-
tk_config = "/usr/lib/tkConfig.sh"
837-
if not (os.path.exists(tcl_config) and os.path.exists(tk_config)):
838-
return None
843+
return None
839844

840845
# These files are shell scripts that set a bunch of
841846
# environment variables. To actually get at the

0 commit comments

Comments
 (0)