From 70d828ebefd26446ad5c46bdb66f2d960411cb72 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 14 May 2020 15:55:58 -0700 Subject: [PATCH] fix prompts in Python 3 Currently because the output is not flushed, the prompt doesn't appear. --- codemod/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codemod/base.py b/codemod/base.py index 7ddd456..da04caa 100755 --- a/codemod/base.py +++ b/codemod/base.py @@ -263,15 +263,15 @@ def _ask_about_patch(patch, editor, default_no): if not yes_to_all: if default_no: print('Accept change (y = yes, n = no [default], e = edit, ' + - 'A = yes to all, E = yes+edit, q = quit)? '), + 'A = yes to all, E = yes+edit, q = quit)?', end=" ", flush=True) else: print('Accept change (y = yes [default], n = no, e = edit, ' + - 'A = yes to all, E = yes+edit, q = quit)? '), + 'A = yes to all, E = yes+edit, q = quit)?', end=" ", flush=True) p = _prompt('yneEAq', default=default_action) else: p = 'y' else: - print('(e = edit [default], n = skip line, q = quit)? ', end=" ") + print('(e = edit [default], n = skip line, q = quit)?', end=" ", flush=True) p = _prompt('enq', default='e') if p in 'A':