|
191 | 191 | # https://www.gnu.org/licenses/ |
192 | 192 | # **************************************************************************** |
193 | 193 |
|
194 | | -from .expect import Expect, ExpectElement, FunctionElement, ExpectFunction |
195 | | -from .gap_workspace import gap_workspace_file, prepare_workspace_dir |
196 | | -from sage.cpython.string import bytes_to_str |
197 | | -from sage.env import SAGE_EXTCODE, SAGE_GAP_COMMAND, SAGE_GAP_MEMORY, GAP_ROOT_PATHS |
198 | | -from sage.misc.misc import is_in_string |
199 | | -from sage.misc.cachefunc import cached_method |
200 | | -from sage.misc.instancedoc import instancedoc |
201 | | -from sage.interfaces.tab_completion import ExtraTabCompletion |
202 | | -from sage.structure.element import ModuleElement |
203 | | - |
204 | | -import sage.interfaces.abc |
205 | | - |
206 | | -import re |
207 | 194 | import os |
208 | | -import pexpect |
209 | | -import time |
210 | 195 | import platform |
| 196 | +import re |
211 | 197 | import string |
| 198 | +import time |
212 | 199 | import warnings |
213 | 200 |
|
| 201 | +import pexpect |
| 202 | + |
| 203 | +import sage.interfaces.abc |
| 204 | +from sage.cpython.string import bytes_to_str |
| 205 | +from sage.env import GAP_ROOT_PATHS, SAGE_EXTCODE, SAGE_GAP_COMMAND, SAGE_GAP_MEMORY |
| 206 | +from sage.interfaces.expect import ( |
| 207 | + Expect, |
| 208 | + ExpectElement, |
| 209 | + ExpectFunction, |
| 210 | + FunctionElement, |
| 211 | +) |
| 212 | +from sage.interfaces.gap_workspace import gap_workspace_file, prepare_workspace_dir |
| 213 | +from sage.interfaces.tab_completion import ExtraTabCompletion |
| 214 | +from sage.misc.cachefunc import cached_method |
| 215 | +from sage.misc.instancedoc import instancedoc |
| 216 | +from sage.misc.misc import is_in_string |
| 217 | +from sage.structure.element import ModuleElement |
| 218 | + |
214 | 219 | WORKSPACE = gap_workspace_file() |
215 | 220 |
|
216 | 221 | first_try = True |
@@ -893,10 +898,9 @@ def function_call(self, function, args=None, kwds=None): |
893 | 898 | res = self.eval(cmd) |
894 | 899 | if self.eval(self._identical_function + '(last,__SAGE_LAST__)') != 'true': |
895 | 900 | return self.new('last2;') |
896 | | - else: |
897 | | - if res.strip(): |
898 | | - from sage.interfaces.interface import AsciiArtString |
899 | | - return AsciiArtString(res) |
| 901 | + elif res.strip(): |
| 902 | + from sage.interfaces.interface import AsciiArtString |
| 903 | + return AsciiArtString(res) |
900 | 904 |
|
901 | 905 | def get_record_element(self, record, name): |
902 | 906 | r""" |
@@ -1072,6 +1076,7 @@ def __init__(self, max_workspace_size=None, |
1072 | 1076 | """ |
1073 | 1077 | EXAMPLES:: |
1074 | 1078 |
|
| 1079 | + sage: from sage.interfaces.gap import gap |
1075 | 1080 | sage: gap == loads(dumps(gap)) |
1076 | 1081 | True |
1077 | 1082 | """ |
|
0 commit comments