summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ttk_guionly.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2011-07-04 04:56:48 (GMT)
committerNed Deily <nad@acm.org>2011-07-04 04:56:48 (GMT)
commit4143535d865b103ebe6cbce51287a63f9538afd3 (patch)
tree7251878d75847b33ddeb842a64df918d25b99aaf /Lib/test/test_ttk_guionly.py
parent9ebe08d2f6c3b8bca5148e909cc89efeb7a01ad1 (diff)
downloadcpython-4143535d865b103ebe6cbce51287a63f9538afd3.zip
cpython-4143535d865b103ebe6cbce51287a63f9538afd3.tar.gz
cpython-4143535d865b103ebe6cbce51287a63f9538afd3.tar.bz2
Issue #8716: Avoid crashes caused by Aqua Tk on OSX when attempting to run
test_tk or test_ttk_guionly under a username that is not currently logged in to the console windowserver (as may be the case under buildbot or ssh).
Diffstat (limited to 'Lib/test/test_ttk_guionly.py')
-rw-r--r--Lib/test/test_ttk_guionly.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_ttk_guionly.py b/Lib/test/test_ttk_guionly.py
index bff4fc1..b8c1a4c 100644
--- a/Lib/test/test_ttk_guionly.py
+++ b/Lib/test/test_ttk_guionly.py
@@ -5,6 +5,10 @@ from test import support
# Skip this test if _tkinter wasn't built.
support.import_module('_tkinter')
+# Skip test if tk cannot be initialized.
+from tkinter.test.support import check_tk_availability
+check_tk_availability()
+
from _tkinter import TclError
from tkinter import ttk
from tkinter.test import runtktests