From c4f493e9b97032580a2cfd190e6ffb54d78e4981 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Thu, 16 Feb 2017 12:24:15 -0600 Subject: [PATCH] Fail faster if maxima is not found. --- pymbolic/interop/maxima.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pymbolic/interop/maxima.py b/pymbolic/interop/maxima.py index ef1f61f..e2daa46 100644 --- a/pymbolic/interop/maxima.py +++ b/pymbolic/interop/maxima.py @@ -282,6 +282,19 @@ class MaximaKernel: for command in PRE_MAXIMA_COMMANDS: self.child.sendline(command) + # {{{ check for maxima command + + self.child.sendline( + "hash \"{command}\"; echo $?".format(command=self.executable)) + + hash_output = self.child.expect(["0\r\n", "1\r\n"]) + if hash_output != 0: + raise RuntimeError( + "maxima executable \"{command}\" not found" + .format(command=self.executable)) + + # }}} + self.child.sendline(" ".join( [self.executable, "--disable-readline", "-q"])) -- GitLab