# HG changeset patch # Parent 4d5826fa77a1a8ac36ff8cc4f22afb6cb9cf56fc diff -r 4d5826fa77a1 -r 350135f904c0 Lib/pydoc.py --- a/Lib/pydoc.py Mon Mar 30 01:01:48 2015 +0300 +++ b/Lib/pydoc.py Sun Mar 29 23:41:51 2015 +0000 @@ -1454,14 +1454,15 @@ pipe.write(text) except OSError: pass # Ignore broken pipes caused by quitting the pager program. - while True: - try: - proc.wait() - break - except KeyboardInterrupt: - # Ignore ctl-c like the pager itself does. Otherwise the pager is - # left running and the terminal is in raw mode and unusable. - pass + finally: + while True: + try: + proc.wait() + break + except KeyboardInterrupt: + # Ignore ctl-c like the pager itself does. Otherwise the pager is + # left running and the terminal is in raw mode and unusable. + pass def tempfilepager(text, cmd): """Page through text by invoking a program on a temporary file."""