From d83c5e2177696b21e41c2c5d447858fb4d47a990 Mon Sep 17 00:00:00 2001 From: Fred Wright Date: Sat, 29 Sep 2018 15:17:30 -0700 Subject: Fixes possible X11 launch in python-versions test. Some of the Gtk imports may have the side effect of launching an X11 server if one isn't currently available (at least on the Mac). This can be suppressed by clearing the DISPLAY environment variable prior to those imports. This fix arranges to apply that to the environment used by the python-versions test. TESTED: Ran "scons python-versions" on OSX, and observed no X11 launch. --- SConstruct | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index 72eedd14..0248cc86 100644 --- a/SConstruct +++ b/SConstruct @@ -1832,17 +1832,17 @@ AlwaysBuild(Alias(".", [], error_action)) # Utility productions -def Utility(target, source, action): - target = env.Command(target=target, source=source, action=action) +def Utility(target, source, action, **kwargs): + target = env.Command(target=target, source=source, action=action, **kwargs) env.AlwaysBuild(target) env.Precious(target) return target -def UtilityWithHerald(herald, target, source, action): +def UtilityWithHerald(herald, target, source, action, **kwargs): if not env.GetOption('silent'): action = ['@echo "%s"' % herald] + action - return Utility(target=target, source=source, action=action) + return Utility(target=target, source=source, action=action, **kwargs) # Putting in all these -U flags speeds up cppcheck and allows it to look @@ -1900,9 +1900,12 @@ if python_progs: # get version from each python prog # this ensures they can run and gps_versions match vchk = '' + verenv = env['ENV'].copy() + verenv['DISPLAY'] = '' # Avoid launching X11 in X11 progs for prog in python_progs: vchk += '$SRCDIR/%s -V\n' % prog - python_versions = Utility('python-versions', [python_progs], vchk) + python_versions = Utility('python-versions', [python_progs], vchk, + ENV=verenv) else: python_versions = None -- cgit v1.2.1