• R David Murray's avatar
    #23792: Ignore KeyboardInterrupt when the pydoc pager is active. · 1058cda3
    R David Murray yazdı
    Previously, if you hit ctl-c while the pager was active, the python that
    launched the subprocess for the pager would see the KeyboardInterrupt in the
    __exit__ method of the subprocess context manager where it was waiting for the
    subprocess to complete, ending the wait.  This would leave the pager running,
    while the interactive interpreter, after handling the exception by printing
    it, would go back to trying to post a prompt...but the pager would generally
    have the terminal in raw mode, and in any case would be still trying to read
    from stdin.  On some systems, even exiting python at that point would not
    restore the terminal mode.  The problem with raw mode could also happen if
    ctl-C was hit when pydoc was called from the shell command line and the pager
    was active.
    
    Instead, we now wait on the subprocess in a loop, ignoring KeyboardInterrupt
    just like the pager does, until the pager actually exits.
    
    (Note: this was a regression relative to python2...in python2 the pager
    is called via system, and system does not return until the pager exits.)
    1058cda3
Adı
Son kayıt (commit)
Son güncelleme
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
Tools Loading commit data...
.bzrignore Loading commit data...
.gitignore Loading commit data...
.hgeol Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
.hgtouch Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
config.guess Loading commit data...
config.sub Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...