]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix k5test prompts for Python 3 819/head
authorGreg Hudson <ghudson@mit.edu>
Wed, 25 Jul 2018 15:50:02 +0000 (11:50 -0400)
committerGreg Hudson <ghudson@mit.edu>
Thu, 26 Jul 2018 14:22:10 +0000 (10:22 -0400)
With Python 3, sys.stdout.write() of a partial line followed by
sys.stdin.readline() does not display the partial line.  Add explicit
flushes to make prompts visible in k5test.py.

ticket: 8710

src/util/k5test.py

index 848eb02be170d0d5d6e7480315b57f65869aa47f..6001246b9a488dbdd2420c6792f910f7a24cb644 100644 (file)
@@ -468,6 +468,7 @@ def _onexit():
     if _debug or _stop_before or _stop_after or _shell_before or _shell_after:
         # Wait before killing daemons in case one is being debugged.
         sys.stdout.write('*** Press return to kill daemons and exit script: ')
+        sys.stdout.flush()
         sys.stdin.readline()
     for proc in _daemons:
         os.kill(proc.pid, signal.SIGTERM)
@@ -669,6 +670,7 @@ def _valgrind(args):
 def _stop_or_shell(stop, shell, env, ind):
     if (_match_cmdnum(stop, ind)):
         sys.stdout.write('*** [%d] Waiting for return: ' % ind)
+        sys.stdout.flush()
         sys.stdin.readline()
     if (_match_cmdnum(shell, ind)):
         output('*** [%d] Spawning shell\n' % ind, True)