Skip to content

Commit 5d5dee0

Browse files
juliantaylorddale
authored andcommitted
search in more paths for tcl/tkConfig.sh
location of the files changed in tcl/tk package 8.5.9-2
1 parent 990262c commit 5d5dee0

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
@@ -908,15 +908,20 @@ def query_tcltk():
908908
return TCL_TK_CACHE
909909

910910
def parse_tcl_config(tcl_lib_dir, tk_lib_dir):
911-
# This is where they live on Ubuntu Hardy (at least)
912-
tcl_config = os.path.join(tcl_lib_dir, "tclConfig.sh")
913-
tk_config = os.path.join(tk_lib_dir, "tkConfig.sh")
911+
import Tkinter
912+
tcl_poss = [tcl_lib_dir,
913+
"/usr/lib/tcl"+str(Tkinter.TclVersion),
914+
"/usr/lib"]
915+
tk_poss = [tk_lib_dir,
916+
"/usr/lib/tk"+str(Tkinter.TkVersion),
917+
"/usr/lib"]
918+
for ptcl, ptk in zip(tcl_poss, tk_poss):
919+
tcl_config = os.path.join(ptcl, "tclConfig.sh")
920+
tk_config = os.path.join(ptk, "tkConfig.sh")
921+
if (os.path.exists(tcl_config) and os.path.exists(tk_config)):
922+
break
914923
if not (os.path.exists(tcl_config) and os.path.exists(tk_config)):
915-
# This is where they live on RHEL4 (at least)
916-
tcl_config = "/usr/lib/tclConfig.sh"
917-
tk_config = "/usr/lib/tkConfig.sh"
918-
if not (os.path.exists(tcl_config) and os.path.exists(tk_config)):
919-
return None
924+
return None
920925

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

0 commit comments

Comments
 (0)