def _check_system(self):
null_commands = self.commands + ["--help"]
if six.PY2:
not_found_exception = IOError
else:
not_found_exception = FileNotFoundError
try:
if six.PY2:
subprocess.check_output(null_commands)
else:
subprocess.check_call(null_commands, stdout=subprocess.DEVNULL)
except not_found_exception:
raise RepositorySystemError("Cannot run {}".format(self.command))
except subprocess.CalledProcessError:
raise RepositorySystemError(
"Error running {}".format(self.command))
评论列表
文章目录