From 4d4e3a8ca62dd9484942d3adf107354468f9897d Mon Sep 17 00:00:00 2001
From: Clifford Wolf <clifford@clifford.at>
Date: Sat, 17 Mar 2018 12:17:53 +0100
Subject: [PATCH] Improve handling of invalid check-sat result in smtio.py

Signed-off-by: Clifford Wolf <clifford@clifford.at>
---
 backends/smt2/smtio.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/backends/smt2/smtio.py b/backends/smt2/smtio.py
index 1d5c89d8e..5c46da4e7 100644
--- a/backends/smt2/smtio.py
+++ b/backends/smt2/smtio.py
@@ -646,12 +646,13 @@ class SmtIo:
                     sys.stderr.flush()
 
         result = self.read()
-        assert result in ["sat", "unsat"]
 
         if self.debug_file:
             print("(set-info :status %s)" % result, file=self.debug_file)
             print("(check-sat)", file=self.debug_file)
             self.debug_file.flush()
+
+        assert result in ["sat", "unsat"]
         return result
 
     def parse(self, stmt):