Skip to content

Commit 671ebba

Browse files
author
Release Manager
committed
gh-39996: Always use python to run the pexpect interface sage-ipython is no longer available in the meson build Fixes #39869 URL: #39996 Reported by: Antonio Rojas Reviewer(s): Tobias Diez
2 parents 97844f4 + a6b5fa4 commit 671ebba

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

src/sage/interfaces/expect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ def _expect_expr(self, expr=None, timeout=None):
12381238
sage: print(sage0.eval("dummy=gp.eval('0'); alarm(1); gp._expect_expr('1')")) # long time
12391239
...Interrupting PARI/GP interpreter. Please wait a few seconds...
12401240
...
1241-
AlarmInterrupt:
1241+
...AlarmInterrupt...
12421242
"""
12431243
if expr is None:
12441244
# the following works around gap._prompt_wait not being defined

src/sage/interfaces/sage0.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ class Sage(ExtraTabCompletion, Expect):
129129
def __init__(self,
130130
logfile=None,
131131
preparse=True,
132-
python=False,
133132
init_code=None,
134133
server=None,
135134
server_tmpdir=None,
@@ -154,24 +153,10 @@ def __init__(self,
154153
'init_code should be a string or an iterable of lines '
155154
'of code')
156155

157-
if python:
158-
command = 'python -u'
159-
prompt = re.compile(b'>>> ')
160-
environment = 'sage.all'
161-
init_code.append(f'from {environment} import *')
162-
else:
163-
command = ' '.join([
164-
'sage-ipython',
165-
# Disable the IPython history (implemented as SQLite database)
166-
# to avoid problems with locking.
167-
'--HistoryManager.hist_file=:memory:',
168-
# Disable everything that prints ANSI codes
169-
'--colors=nocolor',
170-
'--no-term-title',
171-
'--simple-prompt',
172-
])
173-
prompt = re.compile(b'sage: ')
174-
156+
command = 'python3 -u'
157+
prompt = re.compile(b'>>> |sage: |In : ')
158+
environment = 'sage.all'
159+
init_code.append(f'from {environment} import *')
175160
init_code.append('import pickle')
176161
init_code.append(textwrap.dedent("""
177162
def _sage0_load_local(filename):

0 commit comments

Comments
 (0)