Improved error handling in yosys-smtbmc
authorClifford Wolf <clifford@clifford.at>
Sat, 3 Mar 2018 19:00:07 +0000 (20:00 +0100)
committerClifford Wolf <clifford@clifford.at>
Sat, 3 Mar 2018 19:00:07 +0000 (20:00 +0100)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
backends/smt2/smtio.py

index 34e8cf6042da71e96ee6616f1c9d14cdf2b8335b..e6f80d0ac4deb0f19ca504e583ad2a8b27ca3d24 100644 (file)
@@ -135,7 +135,8 @@ class SmtIo:
     def __del__(self):
         if self.p is not None:
             os.killpg(os.getpgid(self.p.pid), signal.SIGTERM)
-            del running_solvers[self.p_index]
+            if running_solvers is not None:
+                del running_solvers[self.p_index]
 
     def setup(self):
         assert not self.setup_done
@@ -264,6 +265,7 @@ class SmtIo:
             data = self.p.stdout.readline().decode("ascii")
             if data == "": break
             self.p_queue.put(data)
+        self.p_queue.put("")
         self.p_running = False
 
     def p_open(self):