소스 검색

Clean up handling output

Nathaniel van Diepen 3 년 전
부모
커밋
12581544f8
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      pacman_repo/repo.py

+ 3 - 2
pacman_repo/repo.py

@@ -10,10 +10,11 @@ class Package(object):
 
     def _exec(self, *args):
         try:
-            subprocess.check_output(args, cwd=self.path)
+            subprocess.run(args, cwd=self.path, capture_output=True, check=True,
+                    text=True)
 
         except subprocess.CalledProcessError as e:
-            print(e.stderr)
+            print("\n".join([e.stdout,e.stderr]))
 
     def _git(self, *args):
         self._exec('git', *args)