summaryrefslogtreecommitdiff
path: root/grc/python/Generator.py
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2014-11-03 10:35:24 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2014-11-03 10:35:24 -0800
commit6e3fbfd50f338932a20edbca3ba4d08e004198b5 (patch)
tree8364c661f6b819c459254fd8d67cc84ea80cb141 /grc/python/Generator.py
parentcd7918af4c5dd846256cc0ddd84cdb075dc6a329 (diff)
parente4873df6d040b2e559d1ae9135627e0ca7f2a6c9 (diff)
Merge branch 'maint'
Diffstat (limited to 'grc/python/Generator.py')
-rw-r--r--grc/python/Generator.py6
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