diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2014-11-02 19:14:07 +0100 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2014-11-02 19:14:07 +0100 |
commit | 8d62df788b01c76e47806f04dc6f064acda334ef (patch) | |
tree | 61611cfbfe34ca59a8ce3ee431e1eb69b0a856ec /grc/python/Generator.py | |
parent | 3f318477ae779ff4cd46728dd223ed092c5b5b1b (diff) |
grc: fix xterm setting check
Diffstat (limited to 'grc/python/Generator.py')
-rw-r--r-- | grc/python/Generator.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/grc/python/Generator.py b/grc/python/Generator.py index caf45fa3b1..4a496b7c0f 100644 --- a/grc/python/Generator.py +++ b/grc/python/Generator.py @@ -21,6 +21,7 @@ import os import sys import subprocess import tempfile +from distutils.spawn import find_executable from Cheetah.Template import Template import expr_utils from Constants import \ @@ -96,8 +97,9 @@ This is usually undesired. Consider removing the throttle block.''') cmds = [python_exe, '-u', self.get_file_path()] # -u is unbuffered stdio # when in no gui mode on linux, use a graphical terminal (looks nice) - if self._generate_options == 'no_gui' and os.path.exists(XTERM_EXECUTABLE): - cmds = [XTERM_EXECUTABLE, '-e'] + cmds + xterm_executable = find_executable(XTERM_EXECUTABLE) + if self._generate_options == 'no_gui' and xterm_executable: + cmds = [xterm_executable, '-e'] + cmds p = subprocess.Popen(args=cmds, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False, universal_newlines=True) return p |