Don't use the shell to catch output, catch output in python. Fixes #17137 (#17449)

This commit is contained in:
Matt Martz 2016-09-09 08:30:37 -05:00 committed by Brian Coca
parent 1df924e1d5
commit eefe359d6b

View file

@ -479,10 +479,13 @@ class CLI(object):
display.display(text)
else:
self.pager_pipe(text, os.environ['PAGER'])
elif subprocess.call('(less --version) &> /dev/null', shell = True) == 0:
self.pager_pipe(text, 'less')
else:
display.display(text)
p = subprocess.Popen('less --version', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.communicate()
if p.returncode == 0:
self.pager_pipe(text, 'less')
else:
display.display(text)
@staticmethod
def pager_pipe(text, cmd):