Skip to content

Commit a4f5fa5

Browse files
committed
Fix Python 3.x build -- Tkinter -> tkinter
1 parent 6c8bf3b commit a4f5fa5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

setupext.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,10 @@ def query_tcltk():
848848

849849
def parse_tcl_config(tcl_lib_dir, tk_lib_dir):
850850
try:
851-
import Tkinter
851+
if sys.version_info[0] < 3:
852+
import Tkinter
853+
else:
854+
import tkinter as Tkinter
852855
except ImportError:
853856
return None
854857

@@ -875,7 +878,7 @@ def get_var(file, varname):
875878
executable="/bin/sh",
876879
stdout=subprocess.PIPE)
877880
result = p.communicate()[0]
878-
return result
881+
return result.decode('ascii')
879882

880883
tcl_lib_dir = get_var(tcl_config, 'TCL_LIB_SPEC').split()[0][2:].strip()
881884
tcl_inc_dir = get_var(tcl_config, 'TCL_INCLUDE_SPEC')[2:].strip()

0 commit comments

Comments
 (0)