瀏覽代碼

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)