From e6c73e5186ff6ffa087b27b50e724b834f159a32 Mon Sep 17 00:00:00 2001 From: whonore Date: Sat, 29 Jun 2024 06:33:36 -0700 Subject: [PATCH] Make quitting during CoqStart slightly more robust --- python/coqtail.py | 2 +- python/coqtop.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/python/coqtail.py b/python/coqtail.py index 26b96c25..0841ec99 100644 --- a/python/coqtail.py +++ b/python/coqtail.py @@ -886,7 +886,7 @@ def parse_msgs(self) -> None: try: msg = self.rfile.readline() msg_id, data = json.loads(msg) - except (json.JSONDecodeError, ConnectionError): + except (json.JSONDecodeError, ConnectionError, ValueError): # Check if channel closed self.closed = True break diff --git a/python/coqtop.py b/python/coqtop.py index 70ea19a5..cbdfa820 100644 --- a/python/coqtop.py +++ b/python/coqtop.py @@ -846,9 +846,7 @@ def interrupt(self) -> None: self.dune.send_signal(signal.SIGTERM) self.dune.wait() self.dune = None - else: - if self.coqtop is None: - raise CoqtopError("Coqtop is not running.") + elif self.coqtop is not None: self.coqtop.send_signal(signal.SIGINT) # Current State #