From c19cc5c508737017f1475f7fd13010a95ed17d1d Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 14 Feb 2020 09:18:15 +0900 Subject: [PATCH] repo: Fix warnings reported by flake8 repo:342:5: E306 expected 1 blank line before a nested definition, found 0 repo:617:5: F841 local variable 'ret' is assigned to but never used Change-Id: I364fdb5dac8ebaff398b848935fe8356cb9ed2d3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255035 Reviewed-by: Mike Frysinger Tested-by: David Pursehouse --- repo | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/repo b/repo index ea3df1d5..40dadac6 100755 --- a/repo +++ b/repo @@ -339,10 +339,12 @@ def run_command(cmd, **kwargs): (cmd[0], ret.returncode), file=sys.stderr) print(' cwd: %s\n cmd: %r' % (kwargs.get('cwd', os.getcwd()), cmd), file=sys.stderr) + def _print_output(name, output): if output: print(' %s:\n >> %s' % (name, '\n >> '.join(output.splitlines())), file=sys.stderr) + _print_output('stdout', ret.stdout) _print_output('stderr', ret.stderr) raise RunError(ret) @@ -614,9 +616,9 @@ def SetupGnuPG(quiet): cmd = ['gpg', '--import'] try: - ret = run_command(cmd, env=env, stdin=subprocess.PIPE, - capture_output=quiet, - input=MAINTAINER_KEYS.encode('utf-8')) + run_command(cmd, env=env, stdin=subprocess.PIPE, + capture_output=quiet, + input=MAINTAINER_KEYS.encode('utf-8')) except OSError: if not quiet: print('warning: gpg (GnuPG) is not available.', file=sys.stderr)