diff options
author | Guilherme Polo <ggpolo@gmail.com> | 2009-02-09 19:57:04 (GMT) |
---|---|---|
committer | Guilherme Polo <ggpolo@gmail.com> | 2009-02-09 19:57:04 (GMT) |
commit | 55bdb8e4ac16c1c0127f122d42b4bc66675598e5 (patch) | |
tree | 97b971383b6861b8d7a1f620e27e1c10ff34a566 /Lib | |
parent | bbb7efd72b3360f0523087cff6868f8fa02fe754 (diff) | |
download | cpython-55bdb8e4ac16c1c0127f122d42b4bc66675598e5.zip cpython-55bdb8e4ac16c1c0127f122d42b4bc66675598e5.tar.gz cpython-55bdb8e4ac16c1c0127f122d42b4bc66675598e5.tar.bz2 |
Checking for tk availability before continuing (basically the same that is done in test_ttk_guionly)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_tk.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_tk.py b/Lib/test/test_tk.py index 5d79a3c..e1f9c5b 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')) |