def popen(self, std_in=None, environ=None):
self.__verify_command()
if self.dry_run:
self.__stdout = self._DRY_RUN_OUTPUT
self.__stderr = self._DRY_RUN_OUTPUT
self.__returncode = 0
self.__debug_logging_method("dry-run: {}".format(self.command))
return subprocess.CompletedProcess(
args=[], returncode=self.__returncode,
stdout=self.__stdout, stderr=self.__stderr)
self.__debug_print_command()
try:
process = subprocess.Popen(
self.command, env=self.__get_env(environ), shell=True,
stdin=std_in, stdout=PIPE, stderr=PIPE)
except TypeError:
process = subprocess.Popen(
self.command, shell=True,
stdin=std_in, stdout=PIPE, stderr=PIPE)
return process
评论列表
文章目录