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
ab5e9b92
Commit
ab5e9b92
authored
Nov 28, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #22314: pydoc now works when the LINES environment variable is set.
parent
fc8e9b0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
Lib/pydoc.py
Lib/pydoc.py
+8
-2
Misc/NEWS
Misc/NEWS
+5
-0
No files found.
Lib/pydoc.py
View file @
ab5e9b92
...
...
@@ -1479,12 +1479,18 @@ def ttypager(text):
old
=
tty
.
tcgetattr
(
fd
)
tty
.
setcbreak
(
fd
)
getchar
=
lambda
:
sys
.
stdin
.
read
(
1
)
except
(
ImportError
,
AttributeError
):
except
(
ImportError
,
AttributeError
,
io
.
UnsupportedOperation
):
tty
=
None
getchar
=
lambda
:
sys
.
stdin
.
readline
()[:
-
1
][:
1
]
try
:
r
=
inc
=
os
.
environ
.
get
(
'LINES'
,
25
)
-
1
try
:
h
=
int
(
os
.
environ
.
get
(
'LINES'
,
0
))
except
ValueError
:
h
=
0
if
h
<=
1
:
h
=
25
r
=
inc
=
h
-
1
sys
.
stdout
.
write
(
'
\
n
'
.
join
(
lines
[:
inc
])
+
'
\
n
'
)
while
lines
[
r
:]:
sys
.
stdout
.
write
(
'-- more --'
)
...
...
Misc/NEWS
View file @
ab5e9b92
...
...
@@ -184,6 +184,11 @@ Documentation
-
Issue
#
21514
:
The
documentation
of
the
json
module
now
refers
to
new
JSON
RFC
7159
instead
of
obsoleted
RFC
4627.
Tools
/
Demos
-----------
-
Issue
#
22314
:
pydoc
now
works
when
the
LINES
environment
variable
is
set
.
Windows
-------
...
...
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