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

Skip to content

Commit 04b4e50

Browse files
committed
work around bad Tkinter version report
1 parent c96a7d0 commit 04b4e50

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

setupext.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,12 @@ def check_for_tk():
843843
gotit = False
844844

845845
if gotit:
846+
try:
847+
tk_v = Tkinter.__version__.split()[-2]
848+
except IndexError:
849+
tk_v = 'version not identified'
846850
print_status("Tkinter", "Tkinter: %s, Tk: %s, Tcl: %s" %
847-
(Tkinter.__version__.split()[-2], Tkinter.TkVersion, Tkinter.TclVersion))
851+
(tk_v, Tkinter.TkVersion, Tkinter.TclVersion))
848852
else:
849853
print_status("Tkinter", "no")
850854
if explanation is not None:

0 commit comments

Comments
 (0)