From c6bfaefff1af90fcdc24de8029d11af5c696be30 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Wed, 20 Feb 2019 15:44:07 -0800 Subject: [PATCH] Fix out-of-scope call for subprocess.CompletedProcess object --- packaging_scripts/repos.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packaging_scripts/repos.py b/packaging_scripts/repos.py index 7f5a1be..9b64b3d 100644 --- a/packaging_scripts/repos.py +++ b/packaging_scripts/repos.py @@ -14,7 +14,6 @@ class RepoAddError(BaseException): # ========== Functions ========== -# TODO generalize this function def db_modify(operation, db, *args): """Run either repo-add or repo-remove. @@ -50,8 +49,8 @@ def db_modify(operation, db, *args): try: process = _run_script(operation, *args) - except subprocess.CalledProcessError: - raise RepoAddError(process.stderr) + except subprocess.CalledProcessError as e: + raise RepoAddError(e) else: syslog.debug(process.stdout) syslog.info('Database operation complete')