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):
12
12
def as_name (self , template ):
13
13
return Path (template ).stem
14
14
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
+
15
23
16
24
__all__ = [
17
25
"BashActivator" ,
Original file line number Diff line number Diff line change @@ -79,15 +79,15 @@ if ! [ -z "${PYTHONHOME+_}" ] ; then
79
79
unset PYTHONHOME
80
80
fi
81
81
82
- if [ __TCL_LIBRARY__ != " '' " ]; then
82
+ if [ __TCL_LIBRARY__ != " " ]; then
83
83
if ! [ -z " ${TCL_LIBRARY+_} " ] ; then
84
84
_OLD_VIRTUAL_TCL_LIBRARY=" $TCL_LIBRARY "
85
85
fi
86
86
TCL_LIBRARY=__TCL_LIBRARY__
87
87
export TCL_LIBRARY
88
88
fi
89
89
90
- if [ __TK_LIBRARY__ != " '' " ]; then
90
+ if [ __TK_LIBRARY__ != " " ]; then
91
91
if ! [ -z " ${TK_LIBRARY+_} " ] ; then
92
92
_OLD_VIRTUAL_TK_LIBRARY=" $TK_LIBRARY "
93
93
fi
Original file line number Diff line number Diff line change @@ -123,7 +123,10 @@ def abs_path(v):
123
123
124
124
self .sysconfig_vars = {i : sysconfig .get_config_var (i or "" ) for i in config_var_keys }
125
125
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
127
130
128
131
confs = {
129
132
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):
48
48
assert "unset _OLD_VIRTUAL_TK_LIBRARY" in content
49
49
50
50
if present :
51
- assert " if [ /path/to/tcl != \" '' \ " ]; then" in content
51
+ assert ' if [ /path/to/tcl != " " ]; then' in content
52
52
assert "TCL_LIBRARY=/path/to/tcl" in content
53
53
assert "export TCL_LIBRARY" in content
54
54
55
- assert " if [ /path/to/tk != \" '' \ " ]; then" in content
55
+ assert ' if [ /path/to/tk != " " ]; then' in content
56
56
assert "TK_LIBRARY=/path/to/tk" in content
57
57
assert "export TK_LIBRARY" in content
58
58
else :
59
59
# 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
61
61
assert "TCL_LIBRARY=''" in content
62
62
# The export is inside the if, so this is fine
63
63
assert "export TCL_LIBRARY" in content
You can’t perform that action at this time.
0 commit comments