def spawn(command): if not re_taint_free.match(command): utils.fubar("Invalid character in \"%s\"." % (command)) if Options["No-Action"]: print "[%s]" % (command) else: (result, output) = commands.getstatusoutput(command) if (result != 0): utils.fubar("Invocation of '%s' failed:\n%s\n" % (command, output), result)
def spawn(command): if not re_taint_free.match(command): utils.fubar("Invalid character in \"%s\"." % (command)) if Options["No-Action"]: print("[%s]" % (command)) else: try: subprocess.check_output(command.split(), stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: utils.fubar("Invocation of '%s' failed:\n%s\n" % (command, e.output.rstrip()), e.returncode)