diff options
author | David Pursehouse <dpursehouse@collab.net> | 2020-02-14 09:18:15 +0900 |
---|---|---|
committer | David Pursehouse <dpursehouse@collab.net> | 2020-02-14 00:42:23 +0000 |
commit | c19cc5c508737017f1475f7fd13010a95ed17d1d (patch) | |
tree | f425c3b5167bfd8b03e578bfefd831a508c3e333 | |
parent | 6fb0cb5c80a4b0f229aa91ece02d4ba05d133a84 (diff) | |
download | git-repo-c19cc5c508737017f1475f7fd13010a95ed17d1d.tar.gz |
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 <vapier@google.com>
Tested-by: David Pursehouse <dpursehouse@collab.net>
-rwxr-xr-x | repo | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -339,10 +339,12 @@ def run_command(cmd, **kwargs): | |||
339 | (cmd[0], ret.returncode), file=sys.stderr) | 339 | (cmd[0], ret.returncode), file=sys.stderr) |
340 | print(' cwd: %s\n cmd: %r' % | 340 | print(' cwd: %s\n cmd: %r' % |
341 | (kwargs.get('cwd', os.getcwd()), cmd), file=sys.stderr) | 341 | (kwargs.get('cwd', os.getcwd()), cmd), file=sys.stderr) |
342 | |||
342 | def _print_output(name, output): | 343 | def _print_output(name, output): |
343 | if output: | 344 | if output: |
344 | print(' %s:\n >> %s' % (name, '\n >> '.join(output.splitlines())), | 345 | print(' %s:\n >> %s' % (name, '\n >> '.join(output.splitlines())), |
345 | file=sys.stderr) | 346 | file=sys.stderr) |
347 | |||
346 | _print_output('stdout', ret.stdout) | 348 | _print_output('stdout', ret.stdout) |
347 | _print_output('stderr', ret.stderr) | 349 | _print_output('stderr', ret.stderr) |
348 | raise RunError(ret) | 350 | raise RunError(ret) |
@@ -614,9 +616,9 @@ def SetupGnuPG(quiet): | |||
614 | 616 | ||
615 | cmd = ['gpg', '--import'] | 617 | cmd = ['gpg', '--import'] |
616 | try: | 618 | try: |
617 | ret = run_command(cmd, env=env, stdin=subprocess.PIPE, | 619 | run_command(cmd, env=env, stdin=subprocess.PIPE, |
618 | capture_output=quiet, | 620 | capture_output=quiet, |
619 | input=MAINTAINER_KEYS.encode('utf-8')) | 621 | input=MAINTAINER_KEYS.encode('utf-8')) |
620 | except OSError: | 622 | except OSError: |
621 | if not quiet: | 623 | if not quiet: |
622 | print('warning: gpg (GnuPG) is not available.', file=sys.stderr) | 624 | print('warning: gpg (GnuPG) is not available.', file=sys.stderr) |