Explorar o código

Clean up handling output

Nathaniel van Diepen %!s(int64=3) %!d(string=hai) anos
pai
achega
12581544f8
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  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)