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
c156e516
Commit
c156e516
authored
Mar 30, 2015
by
R David Murray
Browse files
Options
Browse Files
Download
Plain Diff
Merge: #23792: also catch interrupt around pipe.write.
parents
93692bba
e7f5e147
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
Lib/pydoc.py
Lib/pydoc.py
+6
-1
No files found.
Lib/pydoc.py
View file @
c156e516
...
...
@@ -1451,7 +1451,12 @@ def pipepager(text, cmd):
proc
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stdin
=
subprocess
.
PIPE
)
try
:
with
io
.
TextIOWrapper
(
proc
.
stdin
,
errors
=
'backslashreplace'
)
as
pipe
:
pipe
.
write
(
text
)
try
:
pipe
.
write
(
text
)
except
KeyboardInterrupt
:
# We've hereby abandoned whatever text hasn't been written,
# but the pager is still in control of the terminal.
pass
except
OSError
:
pass
# Ignore broken pipes caused by quitting the pager program.
while
True
:
...
...
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