Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f375b0a4
Commit
f375b0a4
authored
Mar 29, 2015
by
R David Murray
Browse files
Options
Browse Files
Download
Plain Diff
Merge: #23792: Ignore KeyboardInterrupt when the pydoc pager is active.
parents
1b74d630
1058cda3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
Lib/pydoc.py
Lib/pydoc.py
+10
-3
Misc/NEWS
Misc/NEWS
+4
-0
No files found.
Lib/pydoc.py
View file @
f375b0a4
...
...
@@ -1450,11 +1450,18 @@ def pipepager(text, cmd):
import
subprocess
proc
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stdin
=
subprocess
.
PIPE
)
try
:
with
proc
:
with
io
.
TextIOWrapper
(
proc
.
stdin
,
errors
=
'backslashreplace'
)
as
pipe
:
pipe
.
write
(
text
)
with
io
.
TextIOWrapper
(
proc
.
stdin
,
errors
=
'backslashreplace'
)
as
pipe
:
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
def
tempfilepager
(
text
,
cmd
):
"""Page through text by invoking a program on a temporary file."""
...
...
Misc/NEWS
View file @
f375b0a4
...
...
@@ -30,6 +30,10 @@ Core and Builtins
Library
-------
-
Issue
#
23792
:
Ignore
KeyboardInterrupt
when
the
pydoc
pager
is
active
.
This
mimics
the
behavior
of
the
standard
unix
pagers
,
and
prevents
pipepager
from
shutting
down
while
the
pager
itself
is
still
running
.
-
Issue
#
23775
:
pprint
()
of
OrderedDict
now
outputs
the
same
representation
as
repr
().
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment