summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-09-05 04:01:47 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-09-05 04:01:47 (GMT)
commit4847f3194d3a8a58913d94b67f9de09ac765a8d9 (patch)
treecadaab9bd1c0c13450fb5b8bfb9917ec6081e24a /Lib
parent27682d2698cefb9edabffd14290123f439a84790 (diff)
parentfb5ce7eea18b287679f4a8b70c2391f6e9d71833 (diff)
downloadcpython-4847f3194d3a8a58913d94b67f9de09ac765a8d9.zip
cpython-4847f3194d3a8a58913d94b67f9de09ac765a8d9.tar.gz
cpython-4847f3194d3a8a58913d94b67f9de09ac765a8d9.tar.bz2
Merge with 3.5
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/support/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index aa6725f..d907b10 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -466,6 +466,7 @@ def _is_gui_available():
try:
from tkinter import Tk
root = Tk()
+ root.withdraw()
root.update()
root.destroy()
except Exception as e:
@@ -490,12 +491,12 @@ def is_resource_enabled(resource):
def requires(resource, msg=None):
"""Raise ResourceDenied if the specified resource is not available."""
- if resource == 'gui' and not _is_gui_available():
- raise ResourceDenied(_is_gui_available.reason)
if not is_resource_enabled(resource):
if msg is None:
msg = "Use of the %r resource not enabled" % resource
raise ResourceDenied(msg)
+ if resource == 'gui' and not _is_gui_available():
+ raise ResourceDenied(_is_gui_available.reason)
def _requires_unix_version(sysname, min_version):
"""Decorator raising SkipTest if the OS is `sysname` and the version is less