def run_cmd(cmd, dir=".", show=None, output=False, checkfail=True):
if show is None:
show = options.verbose
if show:
print("Running: '%s' in '%s'" % (cmd, dir))
if output:
def run_cmd(cmd, dir=".", show=None, output=False, checkfail=True):
if show is None:
show = options.verbose
if show:
print("Running: '%s' in '%s'" % (cmd, dir))
if output:
- return Popen([cmd], shell=True, stdout=PIPE, cwd=dir).communicate()[0]
+ return Popen(cmd, stdout=PIPE, cwd=dir).communicate()[0]
- run_cmd("killbysubdir %s > /dev/null 2>&1" % self.sdir, checkfail=False)
+ try:
+ run_cmd(["killbysubdir", self.sdir], checkfail=False)
+ except OSError:
+ # killbysubdir doesn't exist ?
+ pass