File tree Expand file tree Collapse file tree 5 files changed +19
-6
lines changed
Expand file tree Collapse file tree 5 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1+ Correctly unpack _get_tcl_tk_libs() response in PythonInfo.
2+ Contributed by :user: `esafak `.
Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ def templates(self):
1212 def as_name (self , template ):
1313 return Path (template ).stem
1414
15+ def replacements (self , creator , dest ):
16+ data = super ().replacements (creator , dest )
17+ data .update ({
18+ "__TCL_LIBRARY__" : creator .interpreter .tcl_lib or "" ,
19+ "__TK_LIBRARY__" : creator .interpreter .tk_lib or "" ,
20+ })
21+ return data
22+
1523
1624__all__ = [
1725 "BashActivator" ,
Original file line number Diff line number Diff line change @@ -79,15 +79,15 @@ if ! [ -z "${PYTHONHOME+_}" ] ; then
7979 unset PYTHONHOME
8080fi
8181
82- if [ __TCL_LIBRARY__ != " '' " ]; then
82+ if [ __TCL_LIBRARY__ != " " ]; then
8383 if ! [ -z " ${TCL_LIBRARY+_} " ] ; then
8484 _OLD_VIRTUAL_TCL_LIBRARY=" $TCL_LIBRARY "
8585 fi
8686 TCL_LIBRARY=__TCL_LIBRARY__
8787 export TCL_LIBRARY
8888fi
8989
90- if [ __TK_LIBRARY__ != " '' " ]; then
90+ if [ __TK_LIBRARY__ != " " ]; then
9191 if ! [ -z " ${TK_LIBRARY+_} " ] ; then
9292 _OLD_VIRTUAL_TK_LIBRARY=" $TK_LIBRARY "
9393 fi
Original file line number Diff line number Diff line change @@ -123,7 +123,10 @@ def abs_path(v):
123123
124124 self .sysconfig_vars = {i : sysconfig .get_config_var (i or "" ) for i in config_var_keys }
125125
126- self .tcl_lib , self .tk_lib = self ._get_tcl_tk_libs () if "TCL_LIBRARY" in os .environ else None , None
126+ if "TCL_LIBRARY" in os .environ :
127+ self .tcl_lib , self .tk_lib = self ._get_tcl_tk_libs ()
128+ else :
129+ self .tcl_lib , self .tk_lib = None , None
127130
128131 confs = {
129132 k : (self .system_prefix if v is not None and v .startswith (self .prefix ) else v )
Original file line number Diff line number Diff line change @@ -48,16 +48,16 @@ def __init__(self, dest):
4848 assert "unset _OLD_VIRTUAL_TK_LIBRARY" in content
4949
5050 if present :
51- assert " if [ /path/to/tcl != \" '' \ " ]; then" in content
51+ assert ' if [ /path/to/tcl != " " ]; then' in content
5252 assert "TCL_LIBRARY=/path/to/tcl" in content
5353 assert "export TCL_LIBRARY" in content
5454
55- assert " if [ /path/to/tk != \" '' \ " ]; then" in content
55+ assert ' if [ /path/to/tk != " " ]; then' in content
5656 assert "TK_LIBRARY=/path/to/tk" in content
5757 assert "export TK_LIBRARY" in content
5858 else :
5959 # When not present, the if condition is false, so the block is not executed
60- assert "if [ '' != \" '' \" ]; then" in content
60+ assert "if [ '' != \" \" ]; then" in content , content
6161 assert "TCL_LIBRARY=''" in content
6262 # The export is inside the if, so this is fine
6363 assert "export TCL_LIBRARY" in content
You can’t perform that action at this time.
0 commit comments