Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #33213: close an open file a bit sooner in gap interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
orlitzky committed Feb 17, 2022
1 parent 339ac94 commit f2b85e2
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/sage/interfaces/gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1300,22 +1300,22 @@ def help(self, s, pager=True):
with io.open(self._local_tmpfile(), "r",
encoding=gap_encoding) as fobj:
help = fobj.read()
if pager:
from IPython.core.page import page
page(help, start=sline)
else:
# Find the n-th line and return from there
idx = -1
while sline:
try:
idx = help.find('\n', idx + 1)
sline -= 1
except ValueError:
# We ran out of lines early somehow; this shouldn't
# happen though
break

return help[idx:]
if pager:
from IPython.core.page import page
page(help, start=sline)
else:
# Find the n-th line and return from there
idx = -1
while sline:
try:
idx = help.find('\n', idx + 1)
sline -= 1
except ValueError:
# We ran out of lines early somehow; this shouldn't
# happen though
break

return help[idx:]

def set(self, var, value):
"""
Expand Down

0 comments on commit f2b85e2

Please sign in to comment.