diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2016-09-05 04:01:47 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2016-09-05 04:01:47 (GMT) |
commit | 4847f3194d3a8a58913d94b67f9de09ac765a8d9 (patch) | |
tree | cadaab9bd1c0c13450fb5b8bfb9917ec6081e24a /Lib/test/support | |
parent | 27682d2698cefb9edabffd14290123f439a84790 (diff) | |
parent | fb5ce7eea18b287679f4a8b70c2391f6e9d71833 (diff) | |
download | cpython-4847f3194d3a8a58913d94b67f9de09ac765a8d9.zip cpython-4847f3194d3a8a58913d94b67f9de09ac765a8d9.tar.gz cpython-4847f3194d3a8a58913d94b67f9de09ac765a8d9.tar.bz2 |
Merge with 3.5
Diffstat (limited to 'Lib/test/support')
-rw-r--r-- | Lib/test/support/__init__.py | 5 |
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 |