Skip to content

Commit

Permalink
On Darwin, fall back to X if DISPLAY is set
Browse files Browse the repository at this point in the history
  • Loading branch information
smontanaro committed Aug 19, 2024
1 parent 48856ea commit 9e5c30b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9e5c30b

Please sign in to comment.