From 069c21d13a1b885286c3ae50232efc1353afc7f6 Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Sat, 7 May 2011 21:36:17 +0200 Subject: [PATCH] search in more paths for tcl/tkConfig.sh location of the files changed in tcl/tk package 8.5.9-2 --- setupext.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/setupext.py b/setupext.py index eed934244140..2d0acd158567 100644 --- a/setupext.py +++ b/setupext.py @@ -827,15 +827,20 @@ def query_tcltk(): return TCL_TK_CACHE def parse_tcl_config(tcl_lib_dir, tk_lib_dir): - # This is where they live on Ubuntu Hardy (at least) - tcl_config = os.path.join(tcl_lib_dir, "tclConfig.sh") - tk_config = os.path.join(tk_lib_dir, "tkConfig.sh") + import Tkinter + tcl_poss = [tcl_lib_dir, + "/usr/lib/tcl"+str(Tkinter.TclVersion), + "/usr/lib"] + tk_poss = [tk_lib_dir, + "/usr/lib/tk"+str(Tkinter.TkVersion), + "/usr/lib"] + for ptcl, ptk in zip(tcl_poss, tk_poss): + tcl_config = os.path.join(ptcl, "tclConfig.sh") + tk_config = os.path.join(ptk, "tkConfig.sh") + if (os.path.exists(tcl_config) and os.path.exists(tk_config)): + break if not (os.path.exists(tcl_config) and os.path.exists(tk_config)): - # This is where they live on RHEL4 (at least) - tcl_config = "/usr/lib/tclConfig.sh" - tk_config = "/usr/lib/tkConfig.sh" - if not (os.path.exists(tcl_config) and os.path.exists(tk_config)): - return None + return None # These files are shell scripts that set a bunch of # environment variables. To actually get at the