diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index e21a0beaf98cb22..d6b06bdb36f83ce 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -267,6 +267,10 @@ class ProcessSerialNumber(Structure): if ( (app_services.GetCurrentProcess(psn_p) < 0) or (app_services.SetFrontProcess(psn_p) < 0) ): reason = "cannot run without OS X gui process" + if reason: + # Try XQuartz + if os.environ.get("DISPLAY") is not None: + reason = None # check on every platform whether tkinter can actually do anything if not reason: