diff options
author | Mike Frysinger <vapier@google.com> | 2020-06-11 20:06:29 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-06-11 20:06:29 +0000 |
commit | a72622e5f70c4b89abd481afaff27f7bb25917b3 (patch) | |
tree | 92e74d2ef7096f34e811a31f16990fb0c236df44 | |
parent | f7259a0da3dc37a6c286991498f9afec03356b33 (diff) | |
parent | 7bd2a9a014a73349c681d43c6bfa0e488a1a2abd (diff) | |
download | repohooks-a72622e5f70c4b89abd481afaff27f7bb25917b3.tar.gz |
utils: run: remove redundant redirect settings am: 7bd2a9a014
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1283335
Change-Id: I91152aabb9fc576855b9dfaa93e2f807dc1c3989
-rwxr-xr-x | pre-upload.py | 6 | ||||
-rw-r--r-- | rh/hooks.py | 1 | ||||
-rw-r--r-- | rh/utils.py | 3 |
3 files changed, 3 insertions, 7 deletions
diff --git a/pre-upload.py b/pre-upload.py index 467e6c8..d7c12aa 100755 --- a/pre-upload.py +++ b/pre-upload.py @@ -419,8 +419,7 @@ def _identify_project(path): a blank string upon failure. """ cmd = ['repo', 'forall', '.', '-c', 'echo ${REPO_PROJECT}'] - return rh.utils.run(cmd, capture_output=True, redirect_stderr=True, - cwd=path).stdout.strip() + return rh.utils.run(cmd, capture_output=True, cwd=path).stdout.strip() def direct_main(argv): @@ -452,8 +451,7 @@ def direct_main(argv): # project from CWD. if opts.dir is None: cmd = ['git', 'rev-parse', '--git-dir'] - git_dir = rh.utils.run(cmd, capture_output=True, - redirect_stderr=True).stdout.strip() + git_dir = rh.utils.run(cmd, capture_output=True).stdout.strip() if not git_dir: parser.error('The current directory is not part of a git project.') opts.dir = os.path.dirname(os.path.abspath(git_dir)) diff --git a/rh/hooks.py b/rh/hooks.py index 3180545..5422494 100644 --- a/rh/hooks.py +++ b/rh/hooks.py @@ -201,7 +201,6 @@ class HookOptions(object): def _run(cmd, **kwargs): """Helper command for checks that tend to gather output.""" - kwargs.setdefault('redirect_stderr', True) kwargs.setdefault('combine_stdout_stderr', True) kwargs.setdefault('capture_output', True) kwargs.setdefault('check', False) diff --git a/rh/utils.py b/rh/utils.py index 53c40b7..6f07a10 100644 --- a/rh/utils.py +++ b/rh/utils.py @@ -282,8 +282,7 @@ class _Popen(subprocess.Popen): # delivered). This isn't particularly informative, but we still # need that info to decide what to do, thus check=False. ret = sudo_run(['kill', '-%i' % signum, str(self.pid)], - redirect_stdout=True, - redirect_stderr=True, check=False) + capture_output=True, check=False) if ret.returncode == 1: # The kill binary doesn't distinguish between permission # denied and the pid is missing. Denied can only occur |