Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5df5830

Browse files
committed
Merge branch 'v1.0.x'
2 parents f8da96a + 069c21d commit 5df5830

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

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)