diff --git a/pymbolic/interop/maxima.py b/pymbolic/interop/maxima.py
index 1486ff7bf0083e6109175b2202ef140bbd0dcc52..2dabf2bcc3fdb32373d87c1adea5d22ec5b94b7f 100644
--- a/pymbolic/interop/maxima.py
+++ b/pymbolic/interop/maxima.py
@@ -345,8 +345,7 @@ class MaximaKernel:
     # {{{ execution control
 
     def restart(self):
-        from signal import SIGKILL
-        self.child.kill(SIGKILL)
+        self.child.close(force=True)
         self._initialize()
 
     def shutdown(self):
diff --git a/test/test_maxima.py b/test/test_maxima.py
index 7dcfa2e580865ee91697a22d1d35f5571ecf4114..7ddbb687dd711b2ff83cadaf8d81c72c0fed8a42 100644
--- a/test/test_maxima.py
+++ b/test/test_maxima.py
@@ -128,6 +128,15 @@ def test_long_command(knl):
     knl.eval_str("+".join(["1"]*16384))
 
 
+def test_restart(knl):
+    pytest.importorskip("pexpect")
+
+    knl = MaximaKernel()
+    knl.restart()
+    knl.eval_str("1")
+    knl.shutdown()
+
+
 if __name__ == "__main__":
     import sys
     if len(sys.argv) > 1: