From: Guilherme Polo Date: Mon, 9 Feb 2009 19:57:04 +0000 (+0000) Subject: Checking for tk availability before continuing (basically the same that is done in... X-Git-Tag: v2.7a1~2067 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55bdb8e4ac16c1c0127f122d42b4bc66675598e5;p=python Checking for tk availability before continuing (basically the same that is done in test_ttk_guionly) --- diff --git a/Lib/test/test_tk.py b/Lib/test/test_tk.py index 5d79a3c220..e1f9c5bfe2 100644 --- a/Lib/test/test_tk.py +++ b/Lib/test/test_tk.py @@ -1,8 +1,14 @@ import os import sys -from _tkinter import TclError +import Tkinter from test import test_support +try: + Tkinter.Button() +except Tkinter.TclError, msg: + # assuming tk is not available + raise test_support.TestSkipped("tk not available: %s" % msg) + this_dir = os.path.dirname(os.path.abspath(__file__)) lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir, 'lib-tk', 'test'))