From 203f9eb6b8624111047656a4ffd805aa53809b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 16 May 2020 12:49:42 +0200 Subject: [PATCH] bandaid for giac pexpect unwanted timing display --- src/sage/interfaces/giac.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/sage/interfaces/giac.py b/src/sage/interfaces/giac.py index f21a06774e4..54b523b36ef 100644 --- a/src/sage/interfaces/giac.py +++ b/src/sage/interfaces/giac.py @@ -580,7 +580,6 @@ def cputime(self, t=None): else: return float(self('time() - %s'%float(t))) - def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if_needed=False): """ EXAMPLES:: @@ -588,16 +587,23 @@ def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if sage: giac._eval_line('2+2') '4' - sage: A=matrix([range(280)]) - sage: GA=giac(A) + sage: A = matrix([range(280)]) + sage: GA = giac(A) + + TESTS:: + + sage: h='int(1/x*((-2*x^(1/3)+1)^(1/4))^3,x)' + sage: giac(h) + 12*(...) """ with gc_disabled(): z = Expect._eval_line(self, line, allow_use_file=allow_use_file, wait_for_prompt=wait_for_prompt) if z.lower().find("error") != -1: raise RuntimeError("An error occurred running a Giac command:\nINPUT:\n%s\nOUTPUT:\n%s"%(line, z)) - return z - + lines = (line for line in z.splitlines() + if not line.startswith('Evaluation time:')) + return "\n".join(lines) def eval(self, code, strip=True, **kwds): r"""