runExternal

lsst.sconsUtils.utils.runExternal(cmd, fatal=False, msg=None)

Safe wrapper for running external programs, reading stdout, and sanitizing error messages.

Parameters:
cmdstr or list or tuple

Command to execute. Shell usage is disabled if a sequence is given. Shell is used if a single command string is given.

fatalbool, optional

Control whether command failure is fatal or not.

msgstr

Message to report on command failure.

Returns:
outputstr

Entire program output is returned, not just a single line.

Raises:
RuntimeError

If the command fails and fatal is True.