# HG changeset patch
# User Gonzalo TornarĂa
# 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 CTRL-C
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/sage/interfaces/maxima.py Tue Apr 21 21:30:25 2009 -0700
+++ b/sage/interfaces/maxima.py Mon May 11 00:29:35 2009 -0300
@@ -627,8 +627,7 @@
v = v[j:]
k = v.find(' ',4)
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[i-1]
- self._sendstr(chr(3))
- self._sendstr(chr(3))
+ self._sendline(";")
self._expect_expr()
raise ValueError, msg
except KeyboardInterrupt, msg: