# HG changeset patch
# User Gonzalo Tornaría <tornaria@math.utexas.edu>
# Date 1242012575 10800
# Node ID 6d2592134149124dbc731217340e8a8af7384539
# Parent 891da50821bd920d08245dfb718a0f99bda908cc
For #5929: fix hang in maxima/ecl due to assumption questions
When maxima asks a question, current code sends CTRLC
twice to break, then raises an exception. This used to work with
clisp, but for ecl it actually hangs. A test case is given by
{{{
var("Ax,Bx,By")
t = Ax*sin(sqrt(Ax^2)/2)/(sqrt(Ax^2)*sqrt(By^2 + Bx^2))
limit(t, Ax=0)
}}}
It turns out that it is possible to "break" from the question by just
sending ";" by itself to maxima. The current patch changes to this
method of escaping. It works with clisp or ecl.
diff r 891da50821bd r 6d2592134149 sage/interfaces/maxima.py
a

b


627  627  v = v[j:] 
628  628  k = v.find(' ',4) 
629  629  msg = "Computation failed since Maxima requested additional constraints (try the command 'assume(" + v[4:k] +">0)' before integral or limit evaluation, for example):\n" + v + self._ask[i1] 
630   self._sendstr(chr(3)) 
631   self._sendstr(chr(3)) 
 630  self._sendline(";") 
632  631  self._expect_expr() 
633  632  raise ValueError, msg 
634  633  except KeyboardInterrupt, msg: 