diff options
author | Daniel Kutik <daniel.kutik@lavawerk.com> | 2022-12-13 12:44:47 +0100 |
---|---|---|
committer | Daniel Kutik <daniel.kutik@lavawerk.com> | 2022-12-13 16:23:28 +0000 |
commit | e641281d144cca09a451497209e748056cdd79bb (patch) | |
tree | f71da9752eebcecd54ddfe7c7e3d6c7986137d24 /subcmds/upload.py | |
parent | 035f22abec2263a48770bffbe04e4cfdc443ff41 (diff) | |
download | git-repo-e641281d144cca09a451497209e748056cdd79bb.tar.gz |
Use print with flush=True instead of stdout.flush
Resolves multiple TODOs. Since we are requiring Python 3,
we move to using print function with flush=True instead of
using sys.stdout.flush().
Change-Id: I54db0344ec78ac81a8d6c6c7e43ee7d301f42f02
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/354701
Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index ceab6463..5b17fb51 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -293,9 +293,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
293 | for commit in commit_list: | 293 | for commit in commit_list: |
294 | print(' %s' % commit) | 294 | print(' %s' % commit) |
295 | 295 | ||
296 | print('to %s (y/N)? ' % remote.review, end='') | 296 | print('to %s (y/N)? ' % remote.review, end='', flush=True) |
297 | # TODO: When we require Python 3, use flush=True w/print above. | ||
298 | sys.stdout.flush() | ||
299 | if opt.yes: | 297 | if opt.yes: |
300 | print('<--yes>') | 298 | print('<--yes>') |
301 | answer = True | 299 | answer = True |
@@ -437,9 +435,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
437 | print('Uncommitted changes in %s (did you forget to amend?):' | 435 | print('Uncommitted changes in %s (did you forget to amend?):' |
438 | % branch.project.name) | 436 | % branch.project.name) |
439 | print('\n'.join(changes)) | 437 | print('\n'.join(changes)) |
440 | print('Continue uploading? (y/N) ', end='') | 438 | print('Continue uploading? (y/N) ', end='', flush=True) |
441 | # TODO: When we require Python 3, use flush=True w/print above. | ||
442 | sys.stdout.flush() | ||
443 | if opt.yes: | 439 | if opt.yes: |
444 | print('<--yes>') | 440 | print('<--yes>') |
445 | a = 'yes' | 441 | a = 'yes' |