diff --git a/pymbolic/interop/maxima.py b/pymbolic/interop/maxima.py index ef1f61fc75338adcdabdc68d900e84b2f53bfe54..e2daa468d353a743793abef32626cfe6f91602af 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"]))