Issue #22314: pydoc now works when the LINES environment variable is set.
This commit is contained in:
parent
86ef95d3fb
commit
46e92503da
|
@ -1446,7 +1446,13 @@ def ttypager(text):
|
|||
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(join(lines[:inc], '\n') + '\n')
|
||||
while lines[r:]:
|
||||
sys.stdout.write('-- more --')
|
||||
|
|
Loading…
Reference in New Issue