@conf
def cmd_and_log(self, cmd, kw):
	Logs.debug('runner: %s\n' % cmd)
	if self.log:
		self.log.write('%s\n' % cmd)

	try:
		p = Utils.pproc.Popen(cmd, stdout=Utils.pproc.PIPE, stderr=Utils.pproc.PIPE, shell=True)
		(out, err) = p.communicate()
	except __HOLE__, e:
		self.log.write('error %r' % e)
		self.fatal(str(e))

	out = str(out)
	err = str(err)

	if self.log:
		self.log.write(out)
		self.log.write(err)

	if p.returncode:
		if not kw.get('errmsg', ''):
			if kw.get('mandatory', False):
				kw['errmsg'] = out.strip()
			else:
				kw['errmsg'] = 'no'
		self.fatal('fail')
	return out
dataset/ETHPy150Open appcelerator-archive/poc-nodejs-desktop/Resources/nodejs/builds/linux/node/lib/node/wafadmin/Tools/config_c.py/cmd_and_log