Skip to content

Commit

Permalink
Trac #19795: GAP3 does not have IsIdenticalObject
Browse files Browse the repository at this point in the history
Looks like a regression introduced in #19585. Reported at
https://groups.google.com/d/msg/sage-devel/MrXp43v3WP4/ju2LwTuvBAAJ
{{{
sage: gap=Gap3('/Applications/gap3r4p4/bin/gap')
sage: gap.RequirePackage('"specht"')
------------------------------------------------------------------------
---
RuntimeError                              Traceback (most recent call
last)
<ipython-input-22-c539883f0214> in <module>()
----> 1 gap.RequirePackage('"specht"')

/Applications/sage/local/lib/python2.7/site-
packages/sage/interfaces/interface.pyc in __call__(self, *args, **kwds)
    605
    606     def __call__(self, *args, **kwds):
--> 607         return self._parent.function_call(self._name,
list(args), kwds)
    608
    609     def _sage_doc_(self):

/Applications/sage/local/lib/python2.7/site-
packages/sage/interfaces/gap.pyc in function_call(self, function, args,
kwds)
    919             self.eval(marker)
    920             res = self.eval(cmd)
--> 921         if self.eval('IsIdenticalObj(last,__SAGE_LAST__)') !=
'true':
    922             return self.new('last2;')
    923         else:

/Applications/sage/local/lib/python2.7/site-
packages/sage/interfaces/gap.pyc in eval(self, x, newlines, strip,
split_lines, **kwds)
    567             if not input_line.endswith(';'):
    568                 input_line += ';'
--> 569         result = Expect.eval(self, input_line, **kwds)
    570         if not newlines:
    571             result = result.replace("\\\n","")

/Applications/sage/local/lib/python2.7/site-
packages/sage/interfaces/expect.pyc in eval(self, code, strip,
synchronize, locals, allow_use_file, split_lines, **kwds)
   1237                 elif split_lines:
   1238                     return '\n'.join([self._eval_line(L,
allow_use_file=allow_use_file, **kwds)
-> 1239                                         for L in
code.split('\n') if L != ''])
   1240                 else:
   1241                     return self._eval_line(code,
allow_use_file=allow_use_file, **kwds)

/Applications/sage/local/lib/python2.7/site-
packages/sage/interfaces/gap.pyc in _eval_line(self, line,
allow_use_file, wait_for_prompt, restart_if_needed)
    765                     return ''
    766             else:
--> 767                 raise RuntimeError(message)
    768
    769         except KeyboardInterrupt:

RuntimeError: Gap3 produced error output
Error, Variable: 'IsIdenticalObj' must have a value

   executing IsIdenticalObj(last,__SAGE_LAST__);
}}}

URL: http://trac.sagemath.org/19795
Reported by: vbraun
Ticket author(s): Travis Scrimshaw, Janoš Vidali
Reviewer(s): Anne Schilling
  • Loading branch information
Release Manager authored and vbraun committed Jan 1, 2016
2 parents 4e7da1b + efdffd5 commit d849cbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sage/interfaces/gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ class Gap_generic(Expect):
code
"""
_identical_function = "IsIdenticalObj"

def _synchronize(self, timeout=0.5, cmd='%s;'):
"""
Expand Down Expand Up @@ -918,7 +919,7 @@ def function_call(self, function, args=None, kwds=None):
else:
self.eval(marker)
res = self.eval(cmd)
if self.eval('IsIdenticalObj(last,__SAGE_LAST__)') != 'true':
if self.eval(self._identical_function + '(last,__SAGE_LAST__)') != 'true':
return self.new('last2;')
else:
if res.strip():
Expand Down
2 changes: 2 additions & 0 deletions src/sage/interfaces/gap3.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ class Gap3(Gap_generic):
- Franco Saliola (Feb 2010)
"""
_identical_function = "IsIdentical"

def __init__(self, command=gap3_cmd):
r"""
Initialize the GAP3 interface and start a session.
Expand Down

0 comments on commit d849cbf

Please sign in to comment.